Skip to content

Commit

Permalink
aliases are output with no quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed May 25, 2018
1 parent a19c056 commit b6514fd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion rt/ml/err.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
step 1
lua ProjectDIR/src/lmod.in.lua bash --regression_testing --version
===========================
Modules based on Lua: Version 7.7.14 2017-11-16 16:23 -07:00
Modules based on Lua: Version 7.7.32 2018-05-09 16:30 -05:00
by Robert McLay [email protected]
===========================
step 2
Expand Down
2 changes: 1 addition & 1 deletion rt/ml/out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ _LMFILES_=ProjectDIR/rt/ml/mf/Core/ml/1.0.lua;
export _LMFILES_;
_ModuleTable_='_ModuleTable_={["MTversion"]=3,depthT={},family={},mT={ml={["fn"]="ProjectDIR/rt/ml/mf/Core/ml/1.0.lua",["fullName"]="ml/1.0",["loadOrder"]=1,propT={},["stackDepth"]=0,["status"]="active",["userName"]="ml",},},mpathA={"ProjectDIR/rt/ml/mf/Core",},}';
export _ModuleTable_;
ml() { eval $($LMOD_DIR/ml_cmd "$@"); };
ml() { eval\ \$\(\$LMOD_DIR/ml_cmd\ \"\$@\"\); };
2 changes: 1 addition & 1 deletion rt/set_alias/out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ _LMFILES_=ProjectDIR/rt/set_alias/mf/test1/1.0.lua:ProjectDIR/rt/set_alias/mf/sf
export _LMFILES_;
_ModuleTable_='_ModuleTable_={["MTversion"]=3,depthT={},family={},mT={sfunc={["fn"]="ProjectDIR/rt/set_alias/mf/sfunc/1.0.lua",["fullName"]="sfunc/1.0",["loadOrder"]=2,propT={},["stackDepth"]=0,["status"]="active",["userName"]="sfunc",},test1={["fn"]="ProjectDIR/rt/set_alias/mf/test1/1.0.lua",["fullName"]="test1/1.0",["loadOrder"]=1,propT={},["stackDepth"]=0,["status"]="active",["userName"]="test1",},},mpathA={"ProjectDIR/rt/set_alias/mf",},["systemBaseMPATH"]="ProjectDIR/rt/set_alias/mf",}';
export _ModuleTable_;
ml() { eval $($LMOD_DIR/ml_cmd "$@"); };
ml() { eval\ \$\(\$LMOD_DIR/ml_cmd\ \"\$@\"\); };
===========================
step 7
lua ProjectDIR/src/lmod.in.lua bash --regression_testing load alias
Expand Down
34 changes: 17 additions & 17 deletions rt/settarg/out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ export _ModuleTable_;
__LMOD_STACK_PROMPT_COMMAND=precmd;
export __LMOD_STACK_PROMPT_COMMAND;
alias cdt=cd\ \$TARG;
dbg() { settarg "$@" dbg; };
empty() { settarg "$@" empty; };
gettargdir() { builtin echo $TARG; };
mdbg() { settarg "$@" mdbg; };
opt() { settarg "$@" opt; };
precmd() { {
local tilde="~";
local H=${HOSTNAME-$(hostname)};
H=${H%%.*};
local SHOST=${SHOST-$H};
eval $(${LMOD_SETTARG_CMD:-:} -s bash);
${SET_TITLE_BAR:-:} "${TARG_TITLE_BAR_PAREN}${USER}@${SHOST}:${PWD/#$HOME/$tilde}";
${USER_PROMPT_CMD:-:};
}
; };
settarg() { eval $($LMOD_SETTARG_CMD -s sh "$@"); };
targ() { builtin echo $TARG; };
dbg() { settarg\ \"\$@\"\ dbg; };
empty() { settarg\ \"\$@\"\ empty; };
gettargdir() { builtin\ echo\ \$TARG; };
mdbg() { settarg\ \"\$@\"\ mdbg; };
opt() { settarg\ \"\$@\"\ opt; };
precmd() { \{
\ \ \ \ \ \ \ \ \ \ \ \ \ local\ tilde=\"\~\";
\ \ \ \ \ \ \ \ \ \ \ \ \ local\ H=\$\{HOSTNAME-\$\(hostname\)\};
\ \ \ \ \ \ \ \ \ \ \ \ \ H=\$\{H%%.\*\};
\ \ \ \ \ \ \ \ \ \ \ \ \ local\ SHOST=\$\{SHOST-\$H\};
\ \ \ \ \ \ \ \ \ \ \ \ \ eval\ \$\(\$\{LMOD_SETTARG_CMD:-:\}\ -s\ bash\);
\ \ \ \ \ \ \ \ \ \ \ \ \ \$\{SET_TITLE_BAR:-:\}\ \"\$\{TARG_TITLE_BAR_PAREN\}\$\{USER\}@\$\{SHOST\}:\$\{PWD/\#\$HOME/\$tilde\}\";
\ \ \ \ \ \ \ \ \ \ \ \ \ \$\{USER_PROMPT_CMD:-:\};
\ \ \ \ \ \ \ \ \ \ \ \}
\ \ \ \ \ \ ; };
settarg() { eval\ \$\(\$LMOD_SETTARG_CMD\ -s\ sh\ \"\$@\"\); };
targ() { builtin\ echo\ \$TARG; };
===========================
step 3
lua ProjectDIR/settarg/settarg_cmd.in.lua -s bash --no_cpu_model dbg
Expand Down
2 changes: 1 addition & 1 deletion shells/Bash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function Bash.shellFunc(self, k, v)
stdout:write("unset -f ",k," 2> /dev/null || true;\n")
dbg.print{ "unset -f ",k," 2> /dev/null || true;\n"}
else
local func = v[1]:gsub(";%s*$","")
local func = v[1]:gsub(";%s*$",""):multiEscaped()
stdout:write(k,"() { ",func,"; };\n")
dbg.print{ k,"() { ",func,"; };\n"}
end
Expand Down

0 comments on commit b6514fd

Please sign in to comment.