Closed GoogleCodeExporter closed 9 years ago
Yes, I think there are (at least :-) two issues here:
1) Handle --help and -h in a reasonable way
2) What happens when no input file is provided -- it drives me crazy that IWYU
aborts here.
I don't know if it's critical that we can display Clang's help text.
Original comment by kim.gras...@gmail.com
on 21 Nov 2012 at 6:12
I think we can use --help to display IWYU help and recommend to use "clang
--help" for Clang help. But I don't know what does "clang -h" mean. Clang
reports
> clang: error: no input files
So need to investigate the purpose of -h flag before using it to display IWYU
help.
Original comment by vsap...@gmail.com
on 25 Nov 2012 at 10:49
IWYU prints help for any unknown flag. It looks like the correct invocation to
get IWYU help is;
$ include-what-you-use --Xiwyu --help
That shows help without complaining.
I guess we can't be sure that clang is available -- if we ever come around to
using IWYU, it will be for code only compiled with GCC and MSVC, so it'd be
nice if IWYU was stand-alone.
I wonder if it would be possible to trap '--help' and redirect clang's help to
'--clang-help' or something.
Original comment by kim.gras...@gmail.com
on 26 Nov 2012 at 6:05
Attached is a simple patch to have IWYU get "--help" unescaped. That means
there's no way to get at Clang's help, but I'm not sure that's a problem. It
would be easy to add another magic word to dispatch to Clang's help, if someone
can think of a good switch.
Original comment by kim.gras...@gmail.com
on 10 Dec 2012 at 7:52
Attachments:
Oh, and it changes the USAGE text to refer to the executable as
"include-what-you-use" instead of "iwyu". I sure hope the executable name being
"include-what-you-use" is not just a thing on Windows...
Original comment by kim.gras...@gmail.com
on 10 Dec 2012 at 8:02
And another patch to get rid of the chaotic behavior where IWYU calls abort()
if invoked without arguments.
Original comment by kim.gras...@gmail.com
on 10 Dec 2012 at 8:07
Attachments:
These patches have been applied as of r396, and I'm happy with the current
behavior. ryan.pavlik, could you update your local copy and see if you think
this issue can be closed?
Original comment by kim.gras...@gmail.com
on 27 Dec 2012 at 2:48
Looks pretty good to me! The only nit I could pick is that the usage line says
"include-what-you-use [-Xiwyu --iwyu_opt] ...."
then says "Here are the <opts> you can specify" - perhaps somehow make this
more clearly indicate that it means the options substituted in for --iwyu_opt?
Original comment by ryan.pav...@gmail.com
on 4 Jan 2013 at 8:00
I saw that the other day and did a double-take too. I think it would be worth
addressing. Volodymyr, could you clarify it, or would you like me to send a
patch?
Original comment by kim.gras...@gmail.com
on 4 Jan 2013 at 10:00
Would
Here are the <iwyu_opts> you can specify:
be clear enough?
Or is it better with an example?
Here are the <iwyu_opts> you can specify (e.g. -Xiwyu --verbose=3):
Original comment by vsap...@gmail.com
on 7 Jan 2013 at 7:45
I think either is fine.
Original comment by kim.gras...@gmail.com
on 7 Jan 2013 at 7:53
Looks good to me, I think this one can be closed.
Original comment by ryan.pav...@gmail.com
on 14 Jan 2013 at 12:38
Fixed in r394, r395, r396 and r427.
Original comment by kim.gras...@gmail.com
on 20 Jan 2013 at 9:05
Original issue reported on code.google.com by
ryan.pav...@gmail.com
on 20 Nov 2012 at 8:08