summaryrefslogtreecommitdiff
path: root/test/main
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-07-03 10:46:55 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-07-03 10:46:55 +0200
commit50062365a2ffe0cea2b2e6feebcc89ac7e45343a (patch)
tree5a51c8a7b9b87b8b0f8a60d5b7895251d18bfd32 /test/main
parent2a559d21621a1b200ea75cb79ce7d0b0945699ce (diff)
test/main: Only print help when called with --help
Diffstat (limited to 'test/main')
-rwxr-xr-xtest/main33
1 files changed, 18 insertions, 15 deletions
diff --git a/test/main b/test/main
index 2a29050..ea71e11 100755
--- a/test/main
+++ b/test/main
@@ -1,12 +1,13 @@
#!/usr/bin/env zsh
setopt err_exit
-typeset -i benchmark=0 test_extended=0 test_security=0
+typeset -i benchmark=0 test_extended=0 test_security=0 help=0
while [[ $1 == --* ]] {
case $1 in
--all) test_extended=1; test_security=1 ;;
--benchmark) benchmark=1 ;;
--extended) test_extended=1 ;;
+ --help) help=1 ;;
--security) test_security=1 ;;
esac
shift
@@ -17,20 +18,22 @@ typeset store_file=${2-/tmp/envstore-$UID}
trap "print -P '\n%N:%i: %B%F{red}Test faild!%F{default}%b'" ZERR
trap "$envstore clear" INT
-cat <<- ente
- Usage: $0 [options] [path to envstore] [path to envstore store file]
- valid options are:
- --all enable all test options (except --benchmark)
- --benchmark do a little benchmark after the test (might cause CPU and HDD stress)
- --extended Test for more than just the new envstore API (invalid invocations etc)
- --security Test for security (world-writable store file etc)
-
- Note: this script will remove/overwrite your envstore store file.
- The envstore script needs to be compatible with the original envstore API,
- that is, it should implement the commends "clear", "rm", "eval",
- "save var" and "save var value"
-
-ente
+if ((help)) {
+ cat <<- ente
+ Usage: $0 [options] [path to envstore] [path to envstore store file]
+ valid options are:
+ --all enable all test options (except --benchmark)
+ --benchmark do a little benchmark after the test (might cause CPU and HDD stress)
+ --extended Test for more than just the new envstore API (invalid invocations etc)
+ --security Test for security (world-writable store file etc)
+
+ Note: this script will remove/overwrite your envstore store file.
+ The envstore script needs to be compatible with the original envstore API,
+ that is, it should implement the commends "clear", "rm", "eval",
+ "save var" and "save var value"
+ ente
+ exit 0
+}
echo "# Documentation"
for i in man/*/*; {