diff options
author | Jacob Keller <jacob.e.keller@intel.com> | 2014-03-31 15:24:00 -0700 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2014-04-03 11:21:04 +0300 |
commit | ea54364a23490e668510613be2a0d98e5123d862 (patch) | |
tree | af9b01b47a8e47b8bbad7b043cbd8e0b30030b70 | |
parent | 4ab8c9a3807fb4b5271cffa0410a554eac19e2a5 (diff) | |
download | aiaiai-ea54364a23490e668510613be2a0d98e5123d862.tar.gz |
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 <jacob.e.keller@intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rwxr-xr-x | email/aiaiai-email-autodetect-project | 28 |
1 files changed, 2 insertions, 26 deletions
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. <cfgfile.ini> - the configuration file. <mbox> - 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 |