Quellcode durchsuchen

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

Tianon Gravi vor 11 Jahren
Ursprung
Commit
9c978391f2
1 geänderte Dateien mit 15 neuen und 15 gelöschten Zeilen
  1. 15 15
      bashbrew/bashbrew.sh

+ 15 - 15
bashbrew/bashbrew.sh

@@ -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) )