From: Michael Tremer Date: Fri, 16 Jul 2010 17:50:10 +0000 (+0200) Subject: network: Optimize help function. X-Git-Tag: 001~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=866de228a4bbbe76e4ec26dfbb5549ea0845eace;p=network.git network: Optimize help function. --- diff --git a/functions.cli b/functions.cli index 14b764d9..9339a7bc 100644 --- a/functions.cli +++ b/functions.cli @@ -354,12 +354,13 @@ function cli_reset() { } function cli_help_requested() { - local argument - for argument in ${1}; do - if [ "${argument}" = "help" -o "${argument}" = "-h" -o "${argument}" = "--help" ]; then + local argument="${1}" + + if [ -n "${argument}" ]; then + if listmatch ${argument} help -h --help; then return ${EXIT_OK} fi - done + fi return ${EXIT_ERROR} }