When running bugzilla-tool, it would be useful to be able to run: $ bugzilla-tool commandname -h and get help on the individual command (instead of all of them).
I'm not sure how to go about doing this, or I would have posted a patch already.
or bugzilla-tool help commandname like git does. Either works. This would compete with Ojan's request to have global arguments truly global: https://bugs.webkit.org/show_bug.cgi?id=26912
bzt help command would be rather easy to implement. You just make a new Command subclass which in execute() knows how to reach back at the command dictionary, lookup the command and then call teh right help-printing functions for the OptionParser created for the command. Would probably need a bunch of method abstraction, but should be straightforward.
I would like to abstract all my crazy command parsing stuff out into one nice OptionParser subclass some day. Then bugzilla-tool itself has nothing to do with all the option parsing stuff, it's just a list of commands which are fed off into this fancy git-like OptionParser class. In a future fantasy word, this subclass could go upstream to python, but I doubt we'd ever reach that.
The "individual help" part of this was fixed by bug 31697. The accepting --help anywhere will be fixed by bug 26912. I'm about to post a patch to make --help spew much much better as part of bug 31771.
With the proposed approach in bug 26912 of having a single options parser object, this bug will become a dupe of bug 26912.
Oh boy. Well, commands support --help now, but it doesn't quite do what you might expect. It prints the global help. So sad. :( I guess we're supposed to treat "tool --help command" different from "tool command --help"? Or I guess we just have to detect that we found a command... This might have been "easier" before parts of bug 26912. bleh.
Looks like "svn commit --help" and "svn --help commit" are both equivalent to "svn help commit". This bug is probably most easily fixed by finally biting the bullet and writing our own help printing instead of hacking into OptionParser's
Can this be closed now?
Well, --help functions strangely, see https://bugs.webkit.org/show_bug.cgi?id=27164#c7, but we could close this if you like.
(In reply to comment #10) > Well, --help functions strangely, see > https://bugs.webkit.org/show_bug.cgi?id=27164#c7, but we could close this if > you like. Okay, let's leave it open to support -h|--help on each command some day.