From: Jacob Keller Date: Mon, 31 Mar 2014 22:24:00 +0000 (-0700) Subject: email-hook: remove options that can't be used X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ea54364a23490e668510613be2a0d98e5123d862;p=users%2Fdedekind%2Faiaiai.git email-hook: remove options that can't be used Hooks don't really support options, so just remove them. Also, use fail_usage instead of die for the exit message, so that we actually show the usage when wrong number of arguments is given. Signed-off-by: Jacob Keller Signed-off-by: Artem Bityutskiy --- diff --git a/email/aiaiai-email-autodetect-project b/email/aiaiai-email-autodetect-project index cba33f7..7be707b 100755 --- a/email/aiaiai-email-autodetect-project +++ b/email/aiaiai-email-autodetect-project @@ -35,10 +35,6 @@ apply. It depends on git-find-base which is included in the helpers folder. - the configuration file. - the mbox file containing the patch series - -Options: - -v, --verbose be verbose; - -h, --help show this text and exit. EOF } @@ -49,7 +45,7 @@ fail_usage() exit 1 } -verbose= +verbose=-v tmpdir= cleanup_handler() { @@ -62,27 +58,7 @@ cleanup_handler() } set_cleanup_handler cleanup_handler -TEMP=`getopt -n $PROG -o i:,C:,p,v,h --long input:,verbose,help -- "$@"` || - fail_usage "" -eval set -- "$TEMP" - -while true; do - case "$1" in - -v|--verbose) verbose=-v - ;; - -h|--help) - show_usage - exit 0 - ;; - --) shift; break - ;; - *) fail_usage "Unrecognized option: $1" - ;; - esac - shift -done - -[ "$#" -eq 2 ] || die "Insufficient or too many arguments" +[ "$#" -eq 2 ] || fail_usage "Insufficient or too many arguments" cfgfile="$(readlink -fv -- "$1")"; shift mbox="$(readlink -fv -- "$1")"; shift