summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-10-23 21:21:42 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-10-23 21:21:42 (EDT)
commit09a410df8490dce69996ef4555e4658dd4721cb4 (patch)
tree2052f76cc666cfa2f40c159eff002080c4fa3f18
parent594c77a22e22da38a216a4b141ba8078b3431b53 (diff)
running_cmd: New variable.
-rw-r--r--lib/cmd.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/cmd.sh b/lib/cmd.sh
index d8550f0..6a0674d 100644
--- a/lib/cmd.sh
+++ b/lib/cmd.sh
@@ -25,6 +25,8 @@ use locale
CMDS='@cmds@'
+running_cmd=
+
load_cmds()
{
local cmd=
@@ -114,7 +116,9 @@ run_cmd()
cmd_clean="$(printf '%s' "${cmd}" | \
tr '[A-Z]' '[a-z]' | tr -C '[a-z0-9_]' '_')"
if is_cmd "${cmd}"; then
+ running_cmd="${cmd}"
"cmd_${cmd_clean}_main" "${@}"
+ running_cmd=''
else
error 1 "$(get_msg 'cmd_not_found')" "${cmd}"
fi