]> www.infradead.org Git - users/dedekind/aiaiai.git/commitdiff
aiaiai: use fail_usage on incorrect number of arguments
authorJacob Keller <jacob.e.keller@intel.com>
Fri, 28 Mar 2014 16:08:31 +0000 (09:08 -0700)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 31 Mar 2014 08:56:03 +0000 (11:56 +0300)
We should display the full usage with an error message when we have an
incorrect number of arguments, rather than just die. The advantage is
that the user will see what the actual usage of the program is, rather
than just a somewhat cryptic error message.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
aiaiai-test-patchset
email/aiaiai-email-dispatcher
email/aiaiai-email-dispatcher-helper
email/aiaiai-email-lda
email/aiaiai-email-test-patchset
gerrit/aiaiai-jenkins-test-patchset
helpers/aiaiai-diff-log
helpers/aiaiai-make-kernel
helpers/aiaiai-match-keywords
helpers/aiaiai-test-bisectability

index 224c70c681a46f123bdb0ce1ea218062d763d614..7bf14139d078d3d9d963838e83aa9b396511b508 100755 (executable)
@@ -341,7 +341,7 @@ while true; do
        shift
 done
 
-[ "$#" -ge 2 ] || die "Insufficient arguments"
+[ "$#" -ge 2 ] || fail_usage "Insufficient arguments"
 
 kernel_tree="$(readlink -ev -- "$1")"; shift
 defconfigs="$@"
index caf66a88dcf75872753edda6ce8c5d682f3032fb..e80aea39e40823e1bdcd0c1e45380f4b6fb66a18 100755 (executable)
@@ -116,7 +116,7 @@ while true; do
        shift
 done
 
-[ "$#" -eq 2 ] || die "Insufficient or too many arguments"
+[ "$#" -eq 2 ] || fail_usage "Insufficient or too many arguments"
 
 program_required "inotifywait" ""
 
index 9558b7799452728e6edd9a369e49e965ef21ddad..36d03a39c4d385663d4753b1e7fae1c93e0d7738 100755 (executable)
@@ -84,7 +84,7 @@ while true; do
        shift
 done
 
-[ "$#" -eq 4 ] || die "Insufficient or too many arguments"
+[ "$#" -eq 4 ] || fail_usage "Insufficient or too many arguments"
 
 mbox="$(readlink -fv -- "$1")"; shift
 fail_file="$1"; shift
index 8d65ae2d7f8c3d0bd77a87bf21a8672f79d4db06..8005e2e893d7fb75c75b2cacc86ca189ea6af2a6 100755 (executable)
@@ -487,7 +487,7 @@ while true; do
        shift
 done
 
-[ "$#" -eq 2 ] || die "Insufficient or too many arguments"
+[ "$#" -eq 2 ] || fail_usage "Insufficient or too many arguments"
 
 program_required "mutt" ""
 program_required "find" ""
index 9d2d05a3e424fa34719e2ad3a59e6bd601bf7778..037695740ad5ed4ea795c36af40277d7fe43aceb 100755 (executable)
@@ -223,7 +223,7 @@ while true; do
        shift
 done
 
-[ "$#" -eq 1 ] || die "Insufficient or too many arguments"
+[ "$#" -eq 1 ] || fail_usage "Insufficient or too many arguments"
 
 program_required "mutt" ""
 program_required "grep" ""
index 629bfcb800a8fa2a50caab2c9c64a3961028c8c0..e94eacbe8fe67e0fba1ca150df85a3fa5824cde5 100755 (executable)
@@ -181,7 +181,7 @@ while true; do
        shift
 done
 
-[ "$#" -ge 4 ] || die "Insufficient arguments"
+[ "$#" -ge 4 ] || fail_usage "Insufficient arguments"
 
 [ -n "$tmpdir" ] || tmpdir="$(mktemp -dt "$PROG.XXXX")"
 
index c7a572aafc5fcf72e4ed88339ac07b8484ec99fd..e5d346fce1aa5c570520b5b4feeedcfb5b81ddc5 100755 (executable)
@@ -165,7 +165,7 @@ while true; do
        shift
 done
 
-[ "$#" = 3 ] || die "Insufficient or too many arguments"
+[ "$#" = 3 ] || fail_usage "Insufficient or too many arguments"
 
 
 compile_helpers "$srcdir"
index 4f438900e0b4e23a918c18de8d986639d81c3ab4..934d88b24b94def509dd517f522c3c5e4c852959 100755 (executable)
@@ -233,7 +233,7 @@ while true; do
        shift
 done
 
-[ "$#" -ge 2 ] || die "Insufficient arguments"
+[ "$#" -ge 2 ] || fail_usage "Insufficient arguments"
 
 compile_helpers "$srcdir"
 
index f316792469edcfa7624c9fd8d9bbe312eec14dda..54af7c5974a02fd48cb9235d9eca9fcc3023cbe4 100755 (executable)
@@ -85,7 +85,7 @@ while true; do
        shift
 done
 
-[ "$#" -eq 1 ] || die "Please, specify exactly one argument - the file with keywords"
+[ "$#" -eq 1 ] || fail_usage "Please, specify exactly one argument - the file with keywords"
 file="$(readlink -ev -- "$1")"
 
 while IFS= read -r kw; do
index 948a8074f8d3f680c6d027ba67cef2c65370aea4..66d5cc57918e5a9732cc17ccbb54ac2861ff33dc 100755 (executable)
@@ -190,7 +190,7 @@ while true; do
        shift
 done
 
-[ "$#" -eq 2 ] || die "Please, specify exactly 2 arguments - the kernel tree and the configuration"
+[ "$#" -eq 2 ] || fail_usage "Please, specify exactly 2 arguments - the kernel tree and the configuration"
 
 kernel_tree="$(readlink -ev -- "$1")"; shift
 defconfig_orig="$1"