aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2019-06-03 20:35:18 +0200
committerTeddy Wing2019-06-03 20:35:18 +0200
commit0f7bee30e4d8791b7ffb72b0a993eda7c189f068 (patch)
tree06ae6f8f0aef4ca3ca16eea2114e53bc21517b63
parent886b6ec9bc450cfa6469a3914fb5d74185ac34e9 (diff)
downloadcode-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-xcode-review4
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}" "$@"