Closed areitz closed 9 years ago
The short form was discussed over several summits and via pants-devel and design doc'd etc at length. It would have been advantageous to express reservations then.
to be fair, reservations to the short form were raised many times (by me). Benjy recorded an action item that may may help mitigate Andy's concern, which is to list the long form of the option alongside the sort form of the option.
@areitz The changes discussed at the summit are now in. Can we close this issue?
While I don't get a stack trace, it still feels confusing. An obvious thing to do (to me), if you're starting off with pants is something like this:
[drift pants (master)]$ ./pants compile --help
...
--[no-]compile-java-warnings
--[no-]warnings Compile with all configured warnings enabled.
(default: True)
...
You see --[no-]warnings
in the help, and think "cool, let's disable the warnings":
[drift pants (master)]$ ./pants compile examples/src/java/com/pants/examples/hello/greet --no-warnings
Exception message: unrecognized arguments: --no-warnings
I think at a minimum, we could improve this error message to include a link to a doc that explains short vs. long arguments. It might also be possible to go a bit farther, and have pants spit out something that says:
Sorry, the argument '--no-warnings' is either ambiguous or doesn't exist. Did you mean:
--[no-]compile-scala-warnings
--[no-]compile-apt-warnings
--[no-]compile-java-warnings
I have no idea how hard it would be to implement that, but I think it would pants a lot more understandable for newcomers (and would even be nice for old-timers).
The short form of the options has been removed from help.
This example works fine:
The same thing, but putting the option at the end, dies horribly:
Using the combined option name does work though:
Maybe we should just get rid of the short form (that follows the task)? I think that the current situation is pretty confusing.