show logging option when user asks for help

* avoid printf to simplify usage() syntax
* add reminder to update usage() when CLI option is added
* preserve indentation for help output

Signed-off-by: Paul Morgan <jumanjiman@gmail.com>
This commit is contained in:
Paul Morgan 2015-09-04 19:25:13 -04:00
parent ed6b0fa348
commit aaffcb8df1

View file

@ -35,10 +35,12 @@ if [ $? -ne 0 ]; then
fi
usage () {
printf "
usage: %s [options]
cat <<EOF
usage: ${myname} [options]
-h optional Print this help message\n" "$myname"
-h optional Print this help message
-l PATH optional Log output in PATH
EOF
exit 1
}
@ -62,6 +64,8 @@ if [ "x$ID" != "x0" ]; then
fi
# Get the flags
# If you add an option here, please
# remember to update usage() above.
while getopts hl: args
do
case $args in