summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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