Bug 27164
Summary: | webkit-patch: Individual commands should support -h|--help | ||
---|---|---|---|
Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> |
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | abarth, eric, mjs |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | 26912, 31697, 31771 | ||
Bug Blocks: |
David Kilzer (:ddkilzer)
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).
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
David Kilzer (:ddkilzer)
I'm not sure how to go about doing this, or I would have posted a patch already.
Eric Seidel (no email)
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
Eric Seidel (no email)
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.
Eric Seidel (no email)
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.
Eric Seidel (no email)
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.
Eric Seidel (no email)
With the proposed approach in bug 26912 of having a single options parser object, this bug will become a dupe of bug 26912.
Eric Seidel (no email)
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.
Eric Seidel (no email)
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
David Kilzer (:ddkilzer)
Can this be closed now?
Eric Seidel (no email)
Well, --help functions strangely, see https://bugs.webkit.org/show_bug.cgi?id=27164#c7, but we could close this if you like.
David Kilzer (:ddkilzer)
(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.