From e776421211a713d182600076ce0ab6b508f9275c Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 10 Jun 2019 19:45:39 +0200 Subject: 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. --- code-review | 3 +-- 1 file changed, 1 insertion(+), 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}" "$@" -- cgit v1.2.3