mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-31 06:22:32 +01:00
exit with proper status on CLI options
* if `-h` is used: exit good * if a non-valid CLI option is used without `-h`: exit bad Signed-off-by: Paul Morgan <jumanjiman@gmail.com>
This commit is contained in:
parent
aaffcb8df1
commit
085b260a7b
1 changed files with 2 additions and 3 deletions
|
@ -41,7 +41,6 @@ usage () {
|
||||||
-h optional Print this help message
|
-h optional Print this help message
|
||||||
-l PATH optional Log output in PATH
|
-l PATH optional Log output in PATH
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
yell "# ------------------------------------------------------------------------------
|
yell "# ------------------------------------------------------------------------------
|
||||||
|
@ -69,9 +68,9 @@ fi
|
||||||
while getopts hl: args
|
while getopts hl: args
|
||||||
do
|
do
|
||||||
case $args in
|
case $args in
|
||||||
h) usage ;;
|
h) usage; exit 0 ;;
|
||||||
l) logger="$OPTARG" ;;
|
l) logger="$OPTARG" ;;
|
||||||
*) usage ;;
|
*) usage; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue