about summary refs log tree commit diff homepage
path: root/runtime/POSIX
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-05-23 20:07:01 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-05-23 20:07:01 +0000
commitd9d90a0a47540af317809c2f7e660e76d4e7fe47 (patch)
treeacb2395087e89688c844402480e25ec01e8f032b /runtime/POSIX
parent266cc79f26aa8df4718f2309808f77a5426f266c (diff)
downloadklee-d9d90a0a47540af317809c2f7e660e76d4e7fe47.tar.gz
Make klee_init_env print some usage instructions with --help.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72338 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/POSIX')
-rw-r--r--runtime/POSIX/klee_init_env.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/POSIX/klee_init_env.c b/runtime/POSIX/klee_init_env.c
index f5609973..5c1cc4fb 100644
--- a/runtime/POSIX/klee_init_env.c
+++ b/runtime/POSIX/klee_init_env.c
@@ -98,6 +98,20 @@ void klee_init_env(int* argcPtr, char*** argvPtr) {
 
   sym_arg_name[4] = '\0';
 
+  // Recognize --help when it is the sole argument.
+  if (argc == 2 && __streq(argv[1], "--help")) {
+  __emit_error("klee_init_env\n\n\
+usage: (klee_init_env) [options] [program arguments]\n\
+  -sym-arg <N>              - Replace by a symbolic argument with length N\n\
+  -sym-args <MIN> <MAX> <N> - Replace by at least MIN arguments and at most\n\
+                              MAX arguments, each with maximum length N\n\
+  -sym-files <NUM> <N>      - Make stdin and up to NUM symbolic files, each\n\
+                              with maximum size N.\n\
+  -sym-stdout               - Make stdout symbolic.\n\
+  -max-fail <N>             - Allow up to <N> injected failures\n\
+  -fd-fail                  - Shortcut for '-max-fail 1'\n\n");
+  }
+
   while (k < argc) {
     if (__streq(argv[k], "--sym-arg") || __streq(argv[k], "-sym-arg")) {
       const char *msg = "--sym-arg expects an integer argument <max-len>";