From 0f7bee30e4d8791b7ffb72b0a993eda7c189f068 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 3 Jun 2019 20:35:18 +0200 Subject: code-review: Pass arguments to subcommand program Since subcommands are separate programs, we need to make sure we pass all remaining arguments along to the subcommand. Without this, I wasn't able to pass a different base branch to my `diff` subcommand. --- code-review | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code-review b/code-review index 7d92e0f..727251a 100755 --- a/code-review +++ b/code-review @@ -13,6 +13,8 @@ function program_exists () { program="code-review" subcommand="$1" +shift + if [ -z "$subcommand" ]; then echo 'TODO: print usage' exit "$EX_USAGE" @@ -23,4 +25,4 @@ if ! program_exists "${program}-${subcommand}"; then exit "$EX_USAGE" fi -eval "${program}-${subcommand}" +eval "${program}-${subcommand}" "$@" -- cgit v1.2.3