Move subcommand checking down so we can "bashbrew --help" without errors

This commit is contained in:
Tianon Gravi 2014-12-19 16:57:24 -07:00
parent be008eaf77
commit e127893b7f
1 changed files with 15 additions and 15 deletions

View File

@ -53,21 +53,6 @@ push options:
EOUSAGE
}
# which subcommand
subcommand="$1"
case "$subcommand" in
build|push)
shift
;;
*)
{
echo "error: unknown subcommand: $1"
usage
} >&2
exit 1
;;
esac
# arg handling
opts="$(getopt -o 'h?' --long 'all,docker:,help,library:,logs:,namespaces:,no-build,no-clone,no-push,src:' -- "$@" || { usage >&2 && false; })"
eval set -- "$opts"
@ -101,6 +86,21 @@ while true; do
esac
done
# which subcommand
subcommand="$1"
case "$subcommand" in
build|push)
shift
;;
*)
{
echo "error: unknown subcommand: $1"
usage
} >&2
exit 1
;;
esac
repos=()
if [ "$buildAll" ]; then
repos=( "$library"/!(MAINTAINERS) )