Originally reported on Google Code with ID 85
When passing --help to the include-what-you-use binary, we get what looks like a clang
usage message, followed by:
error: unable to handle compilation, expected exactly one compiler job in ''
/home/rpavlik/src/third-party/llvm/tools/clang/tools/include-what-you-use/iwyu.cc:3704:
Assertion failed: compiler && "Failed to process argv"
Aborted
When passing -h, the clang usage message isn't printed, but this error message is:
error: no input files
error: unable to handle compilation, expected exactly one compiler job in ''
/home/rpavlik/src/third-party/llvm/tools/clang/tools/include-what-you-use/iwyu.cc:3704:
Assertion failed: compiler && "Failed to process argv"
Aborted
The only way I could get the help to display was to call something like "include-what-you-use
-Xiwyu -h" which gave two errors around the usage info:
include-what-you-use: invalid option -- 'h'
USAGE: iwyu [-Xiwyu --iwyu_opt]... <clang opts> <source file>
Here are the <opts> you can specify:
--check_also=<glob>: tells iwyu to print iwyu-violation info
for all files matching the given glob pattern (in addition
to the default of reporting for the input .cc file and its
associated .h files). This flag may be specified multiple
times to specify multiple glob patterns.
--cwd=<dir>: tells iwyu what the current working directory is.
--help: prints this help and exits.
--howtodebug[=<filename>]: with no arg, prints instructions on
how to run iwyu under gdb for the input file, and exits.
With an arg, prints only when input file matches the arg.
--mapping_file=<filename>: gives iwyu a mapping file.
--transitive_includes_only: do not suggest that a file add
foo.h unless foo.h is already visible in the file's
transitive includes.
--verbose=<level>: the higher the level, the more output.
FATAL ERROR: unknown flag.
Alternately -Xiwyu --help displayed the usage text without the two errors.
</level></filename></filename></dir></glob></opts></source></clang>
Reported by ryan.pavlik on 2012-11-20 20:08:49
该提问来源于开源项目:include-what-you-use/include-what-you-use