diff options
author | Mike Burns <mike@mike-burns.com> | 2014-05-30 14:17:32 +0200 |
---|---|---|
committer | Mike Burns <mike@mike-burns.com> | 2014-05-30 14:58:57 +0200 |
commit | 19b5663b9ef06a800831d09a3cbceb937923429d (patch) | |
tree | 78bf483d7418e5a4f4b9e922f1dd9ee3c4be967e /test/mkrc-usage.t | |
parent | cda41b5f2a5e9ab38e340f802503c745f77e681e (diff) |
On bad args, show usage and exit
The lsrc(1), mkrc(1), rcup(1), and rcdn(1) commands will now print a
usage message and exit immediately (with 64, `EX_USAGE`) when given an
option it does not understand.
This includes `--version` and `--help`.
Normal `-h` will print usage and exit successfully, as normal.
Closes #59.
Diffstat (limited to 'test/mkrc-usage.t')
-rw-r--r-- | test/mkrc-usage.t | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/mkrc-usage.t b/test/mkrc-usage.t index d4f4a9f..4649152 100644 --- a/test/mkrc-usage.t +++ b/test/mkrc-usage.t @@ -1,14 +1,21 @@ $ . "$TESTDIR/helper.sh" -no arguments should output usage information and exit 1 +no arguments should output usage information and exit EX_USAGE $ mkrc Usage: mkrc [-ChSsVvqo] [-t TAG] [-d DIR] [-B HOSTNAME] FILES ... see mkrc(1) and rcm(7) for more details - [1] + [64] -h should output usage information and exit 0 $ mkrc -h Usage: mkrc [-ChSsVvqo] [-t TAG] [-d DIR] [-B HOSTNAME] FILES ... see mkrc(1) and rcm(7) for more details + +Unsupported options should output usage information and exit EX_USAGE + + $ mkrc --version + Usage: mkrc [-ChSsVvqo] [-t TAG] [-d DIR] [-B HOSTNAME] FILES ... + see mkrc(1) and rcm(7) for more details + [64] |