diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cmd.sh | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -27,7 +27,7 @@ cmds= load_cmds() { - local cmd + local cmd= for cmd in ${PKGLIBCMD}; do cmd="${cmd##*/}" @@ -39,7 +39,10 @@ load_cmds() print_cmd_summaries() { - local padding cmd cmd_clean summary + local padding= + local cmd= + local cmd_clean= + local summary= padding="$(printf '%24s' '')" for cmd in ${PKGLIBCMD}; do @@ -60,9 +63,9 @@ print_cmd_summaries() print_cmd_usage() { - local cmd cmd_clean usage - - cmd="${1}" + local cmd="${1}" + local cmd_clean= + local usage= cmd_clean="$(printf '%s' "${cmd}" | \ tr '[A-Z]' '[a-z]' | tr -C '[a-z0-9_]' '_')" @@ -73,18 +76,14 @@ print_cmd_usage() is_cmd() { - local cmd - - cmd="${1}" + local cmd="${1}" [ "x$(printf '%s' "${cmds}" | grep "^${cmd}$")" = "x${cmd}" ] } run_cmd() { - local cmd - - cmd="${1}" + local cmd="${1}" shift if is_cmd "${cmd}"; then |