diff options
author | Teddy Wing | 2019-06-10 19:45:39 +0200 |
---|---|---|
committer | Teddy Wing | 2019-06-10 19:45:39 +0200 |
commit | e776421211a713d182600076ce0ab6b508f9275c (patch) | |
tree | fcd7051df507bc99bc503a112f361bfd76db8c11 | |
parent | 3f10e26f98abaf1ebf7519427f2dfbb5eb03db15 (diff) | |
download | code-review-e776421211a713d182600076ce0ab6b508f9275c.tar.bz2 |
code-review: Fix `--help` argument
The `shift` call came before I was checking the first argument `$1` if
it was '--help'. This caused the program to print the 'nonexistent
command' error message. Move the `shift` call to just before we pass on
the rest of the command line arguments.
-rwxr-xr-x | code-review | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/code-review b/code-review index fb3ce2d..a97df7a 100755 --- a/code-review +++ b/code-review @@ -45,8 +45,6 @@ function program_exists () { program="code-review" subcommand="$1" -shift - if [ -z "$subcommand" ] || [ "$1" = '--help' ] || [ "$1" = '-h' ]; then print_usage exit "$EX_USAGE" @@ -57,4 +55,5 @@ if ! program_exists "${program}-${subcommand}"; then exit "$EX_USAGE" fi +shift eval "${program}-${subcommand}" "$@" |