Many interpreters support startup script being executed before command prompt.
I propose to add the following features similar to python ($PYTHONSTARTUP), bash(.bashrc, .bash_profile), zsh (.zprofile, .zshrc) :
-
If the file
.cling_profile
exists, cling binary executes it after launch and right before doing “real work” (showing command promt or executing scripts from argv). -
If the file
.clingrc
exists, cling execute it after.cling_profile
and before the “real work”. However, only do this when cling is invoked as in the interactive mode (the mode with a command prompt). -
Search order for
.cling_profile
and.clingrc
:- ${CLING_HOME} environment variable (or CLING_ROOT ? please suggest names)
- ${XDG_CONFIG_HOME}/cling/ (please refer to XDG Base Directory Specification . As a new forum user I cannot post links here)
- ${HOME}/.config/cling/
- ${HOME}/
P.S. I have implemented the above features and used them on my local cling. I would like to collect some feedback before creating a pull request.