aboutsummaryrefslogtreecommitdiff
path: root/tests/003-too_many_arguments.sh
diff options
context:
space:
mode:
authorJan Sucan <jan@jansucan.com>2022-06-18 08:50:45 +0200
committerJan Sucan <jan@jansucan.com>2022-06-18 08:50:54 +0200
commit948a65cf39c8ce31c5adc0f24979e0cb55bc33c3 (patch)
treeae923f4594fef0abb777f63291d62530c345b229 /tests/003-too_many_arguments.sh
parente1d10bea5d9fc94ba800ade1de430c7f3c0ccacd (diff)
Refactor the command line interface
Select operation by its name instead of by number of the arguments.
Diffstat (limited to 'tests/003-too_many_arguments.sh')
-rw-r--r--tests/003-too_many_arguments.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/003-too_many_arguments.sh b/tests/003-too_many_arguments.sh
new file mode 100644
index 0000000..fc51a42
--- /dev/null
+++ b/tests/003-too_many_arguments.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+source ./assert.sh
+
+PROGRAM_EXEC="$1"
+
+assert "Usage" "too many arguments" 1 $PROGRAM_EXEC backup arg1 arg2 arg3 arg4
+assert "Usage" "too many arguments" 1 $PROGRAM_EXEC restore arg1 arg2 arg3
+
+exit 0