Improve handling of options allowed for "lb" before the sub-command
This commit is contained in:
parent
104fa20399
commit
55d9b213cf
37
frontend/lb
37
frontend/lb
|
@ -19,25 +19,26 @@ DESCRIPTION="Utility to build live systems"
|
||||||
HELP=""
|
HELP=""
|
||||||
USAGE="lb {clean|config|build}"
|
USAGE="lb {clean|config|build}"
|
||||||
|
|
||||||
case "${1}" in
|
# This bits of code relies on the fact that we only accept
|
||||||
-h|--help)
|
# options without values before the real command.
|
||||||
if [ $(which man) ]; then
|
GLOBAL_ARGS=""
|
||||||
man lb
|
while true; do
|
||||||
else
|
case $1 in
|
||||||
Usage
|
-*)
|
||||||
fi
|
GLOBAL_ARGS="${GLOBAL_ARGS:+$GLOBAL_ARGS }$1"
|
||||||
exit 0
|
shift
|
||||||
;;
|
;;
|
||||||
|
*)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
Arguments $GLOBAL_ARGS
|
||||||
|
|
||||||
""|-u|--usage)
|
if [ $# = 0 ]; then
|
||||||
Usage
|
Echo_error "Missing sub-command"
|
||||||
;;
|
Usage --fail
|
||||||
|
fi
|
||||||
-v|--version)
|
|
||||||
echo "${VERSION}"
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
COMMAND="${1}"
|
COMMAND="${1}"
|
||||||
shift
|
shift
|
||||||
|
|
Loading…
Reference in New Issue