diff options
-rw-r--r-- | README.md | 18 | ||||
-rwxr-xr-x | kerl | 50 |
2 files changed, 68 insertions, 0 deletions
@@ -215,6 +215,24 @@ Deactivation is the same as in other shells: Please note: if you've installed a build with an older version of kerl (1.2.0 older) it won't have the `activate.fish` script. +C shell support +--------------- + +kerl has basic support for the C shells (csh/tcsh/etc.). + +To activate an installation: + + source /path/to/install/dir/activate.csh + +The activation script sources file .kerlrc.csh instead of .kerlrc. + +Deactivation is the same as in other shells: + + kerl_deactivate + +Please note: if you've installed a build with an older version of kerl +it won't have the `activate.csh` script. + Glossary -------- @@ -768,6 +768,56 @@ if set --query KERL_ENABLE_PROMPT end end ACTIVATE_FISH + + cat <<ACTIVATE_CSH > "$absdir/activate.csh" +# This file must be used with "source bin/activate.csh" *from csh*. +# You cannot run it directly. + +alias kerl_deactivate 'test \$?_KERL_SAVED_PATH != 0 && setenv PATH "\$_KERL_SAVED_PATH" && unset _KERL_SAVED_PATH; rehash; test \$?_KERL_SAVED_MANPATH != 0 && setenv MANPATH "\$_KERL_SAVED_MANPATH" && unset _KERL_SAVED_MANPATH; test \$?_KERL_SAVED_REBAR_PLT_DIR != 0 && setenv REBAR_PLT_DIR "\$_KERL_SAVED_REBAR_PLT_DIR" && unset _KERL_SAVED_REBAR_PLT_DIR; test \$?_KERL_ACTIVE_DIR != 0 && unset _KERL_ACTIVE_DIR; test \$?_KERL_SAVED_PROMP != 0 && set prompt="\$_KERL_SAVED_PROMP" && unset _KERL_SAVED_PROMP; test "\!:*" != "nondestructive" && unalias deactivate' + +# Unset irrelevant variables. +kerl_deactivate nondestructive + +if ( \$?REBAR_PLT_DIR ) then + set _KERL_SAVED_REBAR_PLT_DIR = "\$REBAR_PLT_DIR" +else + set _KERL_SAVED_REBAR_PLT_DIR="" +endif + +set _KERL_PATH_REMOVABLE = "$absdir/bin" +set _KERL_SAVED_PATH = "\$PATH" +setenv PATH "\${_KERL_PATH_REMOVABLE}:\$PATH" + +if ( ! \$?MANPATH ) then + set MANPATH = "" +endif +set _KERL_MANPATH_REMOVABLE = "$absdir/lib/erlang/man:$absdir/man" +set _KERL_SAVED_MANPATH = "\$MANPATH" +setenv MANPATH "\${_KERL_MANPATH_REMOVABLE}:\$MANPATH" + +setenv REBAR_PLT_DIR "$absdir" + +set _KERL_ACTIVE_DIR = "$absdir" + +if ( -f "$KERL_CONFIG.csh" ) then + source "$KERL_CONFIG.csh" +endif + +if ( \$?KERL_ENABLE_PROMPT ) then + set _KERL_SAVED_PROMP = "\$prompt" + + if ( \$?KERL_PROMPT_FORMAT ) then + set FRMT = "\$KERL_PROMPT_FORMAT" + else + set FRMT = "(%BUILDNAME%)" + endif + + set PROMPT = \`echo "\$FRMT" | sed 's^%RELEASE%^$rel^;s^%BUILDNAME%^$1^'\` + set prompt = "\$PROMPT\$prompt" +endif + +rehash +ACTIVATE_CSH if [ -n "$KERL_BUILD_DOCS" ]; then DOC_DIR="$KERL_BUILD_DIR/$1/release_$rel/lib/erlang" if [ -d "$DOC_DIR" ]; then |