From 4c4dee4825a9a5ecf912cf0bc098dbdd4da221a5 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 16 Jul 2013 18:33:55 -0400 Subject: lib/cmd.sh: Update code style. --- (limited to 'lib') diff --git a/lib/cmd.sh b/lib/cmd.sh index efb8b8c..0558971 100644 --- a/lib/cmd.sh +++ b/lib/cmd.sh @@ -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 -- cgit v0.9.1