diff options
author | Teddy Wing | 2019-06-03 20:35:18 +0200 |
---|---|---|
committer | Teddy Wing | 2019-06-03 20:35:18 +0200 |
commit | 0f7bee30e4d8791b7ffb72b0a993eda7c189f068 (patch) | |
tree | 06ae6f8f0aef4ca3ca16eea2114e53bc21517b63 | |
parent | 886b6ec9bc450cfa6469a3914fb5d74185ac34e9 (diff) | |
download | code-review-0f7bee30e4d8791b7ffb72b0a993eda7c189f068.tar.bz2 |
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.
-rwxr-xr-x | code-review | 4 |
1 files changed, 3 insertions, 1 deletions
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}" "$@" |