Implement -h option.
@@ -245,8 +245,23 @@ static void init_options (int argc, char *argv[]) {
code_len = strlen ((char *) code);
} else if (*argv[i] != '-') {
VARR_PUSH (char_ptr_t, source_file_names, argv[i]);
+ } else if (strcmp (argv[i], "-h") == 0) {
+ fprintf (stderr, "Usage: %s options (-i | -s \"program\" | source files); where options are:\n", argv[0]);
+ fprintf (stderr, "\n");
+ fprintf (stderr, " -v, -d, -dg -- output work, general debug, or MIR-generator debug info\n");
+ fprintf (stderr, " -E -- output C preprocessed code into stdout\n");
+ fprintf (stderr, " -Dname[=value], -Uname -- predefine or unpredefine macros\n");
+ fprintf (stderr, " -Idir, -Ldir -- add directories to search include headers or lbraries\n");
+ fprintf (stderr, " -fpreprocessed -- assume preprocessed input C\n");
+ fprintf (stderr, " -fsyntax-only -- check C code correctness only\n");
+ fprintf (stderr, " -fpedantic -- assume strict standard input C code\n");
+ fprintf (stderr, " -S, -c -- generate corresponding textual or binary MIR files\n");
+ fprintf (stderr, " -o file -- put output code into given file\n");
+ fprintf (stderr, " -On -- use given optimization level in MIR-generator\n");
+ fprintf (stderr, " (-ei | -eg | -el) options -- execute code in the interpreter or (lazily) generated code with given options\n");
+ exit (0);
} else {
- fprintf (stderr, "unknown command line option %s (use -h for usage) -- goodbye", argv[i]);
+ fprintf (stderr, "unknown command line option %s (use -h for usage) -- goodbye\n", argv[i]);
exit (1);
}
}
