summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-07-16 18:33:55 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-07-16 18:33:55 (EDT)
commit4c4dee4825a9a5ecf912cf0bc098dbdd4da221a5 (patch)
treea6b1b891604453b43a83c06c6cb1c988a8ecfd51
parent862417c2e2c2158d425eb96dc9dd502da28b6ea8 (diff)
lib/cmd.sh: Update code style.
-rw-r--r--lib/cmd.sh21
1 files changed, 10 insertions, 11 deletions
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