Make build script respond to -h option

It is usually considered good practice for a script to respond to both
short style `-h` and long style `--help` options to display help
message.

This commits adds support for short style `-h` option.

Change-Id: I8426b5ec136d08b3a476beea3cb983089e08c401
This commit is contained in:
Martin André 2014-12-29 15:17:54 +09:00
parent 1fcf0bee5f
commit ed493b84e0

View File

@ -10,7 +10,7 @@ TAG=$(git rev-parse --short HEAD)
usage () {
cat <<EOF
$0: usage: $0 [options]
Usage: $0 [options]
Options:
@ -25,14 +25,14 @@ EOF
[ -f $IMGDIR/.buildconf ] && . $IMGDIR/.buildconf
[ -f $TOPDIR/.buildconf ] && . $TOPDIR/.buildconf
ARGS=$(getopt -o 'n:t:pN' -l help,namespace:,push,release,tag:,no-cache -- "$@") || { usage >&2; exit 2; }
ARGS=$(getopt -o hn:t:pN -l help,namespace:,push,release,tag:,no-cache -- "$@") || { usage >&2; exit 2; }
eval set -- "$ARGS"
while :; do
case "$1" in
(--help) usage
(--help|-h) usage
exit 0
;;