setenv LMOD_ROOT                 "/usr/share/lmod"
setenv LMOD_PKG                  "/usr/share/lmod/lmod"
setenv LMOD_CMD                  "$LMOD_PKG/libexec/lmod"
setenv LMOD_DIR                  "$LMOD_PKG/libexec"
setenv MODULESHOME               "$LMOD_PKG"      
setenv TARG_TITLE_BAR_PAREN      " "
setenv LMOD_SETTARG_FULL_SUPPORT no

if ( ! $?LMOD_SETTARG_CMD ) then
  setenv LMOD_SETTARG_CMD true
endif

set SUPPORT_KSH = "no"

if ( $SUPPORT_KSH == yes && ! $?__LMOD_SET_FPATH ) then
    setenv __LMOD_SET_FPATH 1
    setenv FPATH            `/usr/share/lmod/lmod/libexec/addto FPATH /usr/share/lmod/lmod/init/ksh_funcs`
endif


set prefix  = ""
set postfix = ""
set merge   = "&&"

set histchar = \!
if ( $?histchars) then
  set histchar   = `echo $histchars | cut -c1`
  if ( "$histchar" != '\!' ) then
    set _histchars = $histchars
    set prefix  = 'set _histchars = $histchars; unset histchars;'
    set postfix = '&& set histchars = $_histchars'
  endif
endif


if ($?tcsh) then
  alias module $prefix'set __LMOD_v=`$LMOD_DIR/protectedVarsHelper.csh`' $merge 'eval `env  $__LMOD_v $LMOD_CMD tcsh --protected_vars '$histchar'*` ' $merge ' eval `env  $__LMOD_v $LMOD_SETTARG_CMD -s csh`' $merge unset __LMOD_v
else
  alias module $prefix'set __LMOD_v=`$LMOD_DIR/protectedVarsHelper.csh`' $merge 'eval `env  $__LMOD_v $LMOD_CMD  csh --protected_vars '$histchar'*` ' $merge unset __LMOD_v
endif
alias clearMT    'eval `'$LMOD_DIR/clearLMOD_cmd --shell csh --simple'`'
alias clearLmod  module --force purge $merge 'eval `'$LMOD_DIR/clearLMOD_cmd --shell csh --full $histchar'*' '`'

alias ml      'eval `'$LMOD_DIR/ml_cmd' '$histchar'*`'

setenv LMOD_VERSION '9.2.8'

unset SUPPORT_KSH
unset prefix
unset midfix
unset postfix
unset histchar
unset merge
set echo_style=both  # this variable must be set for precmd in the settarg module to work!

# Local Variables:
# mode: shell-script
# indent-tabs-mode: nil
# end:

