From d9d90a0a47540af317809c2f7e660e76d4e7fe47 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 23 May 2009 20:07:01 +0000 Subject: 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 --- runtime/POSIX/klee_init_env.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'runtime') 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 - Replace by a symbolic argument with length N\n\ + -sym-args - Replace by at least MIN arguments and at most\n\ + MAX arguments, each with maximum length N\n\ + -sym-files - Make stdin and up to NUM symbolic files, each\n\ + with maximum size N.\n\ + -sym-stdout - Make stdout symbolic.\n\ + -max-fail - Allow up to 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 "; -- cgit 1.4.1