aboutsummaryrefslogtreecommitdiff
path: root/tests/005-missing_argument_for_option.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/005-missing_argument_for_option.sh
parente1d10bea5d9fc94ba800ade1de430c7f3c0ccacd (diff)
Refactor the command line interface
Select operation by its name instead of by number of the arguments.
Diffstat (limited to 'tests/005-missing_argument_for_option.sh')
-rw-r--r--tests/005-missing_argument_for_option.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/005-missing_argument_for_option.sh b/tests/005-missing_argument_for_option.sh
new file mode 100644
index 0000000..faccbdd
--- /dev/null
+++ b/tests/005-missing_argument_for_option.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+source ./assert.sh
+
+PROGRAM_EXEC="$1"
+
+assert "Usage" "missing argument for option '-b'" 1 $PROGRAM_EXEC backup -b
+assert "Usage" "missing argument for option '-s'" 1 $PROGRAM_EXEC backup -s
+
+assert "Usage" "missing argument for option '-b'" 1 $PROGRAM_EXEC restore -b
+assert "Usage" "missing argument for option '-s'" 1 $PROGRAM_EXEC restore -s
+
+exit 0