RESOLVED FIXED 26912
bugzilla-tool should accept global options anywhere
https://bugs.webkit.org/show_bug.cgi?id=26912
Summary bugzilla-tool should accept global options anywhere
Eric Seidel (no email)
Reported 2009-07-01 18:25:36 PDT
bugzilla-tool should accept global options anywhere Right now bugzilla-tool makes sure that you put the global options before the command. I don't think this is what we actually want. Meaning: bugzilla-tool post-diff --help will error out instead of displaying the global help. Likewise: bugzilla-tool post-diff --dry-run will be an error. This will be simple to fix, but will require our first option-parse pass to ignore options it does not understand.
Attachments
Patch (16.03 KB, patch)
2009-12-23 22:55 PST, Eric Seidel (no email)
no flags
Eric Seidel (no email)
Comment 1 2009-12-10 00:08:43 PST
Adam points out that the easy way to do this would be to simply have a single option parser, and to just have the tool be smart enough to add in the options from whatever command is chosen. Basically run looks like this: 1. Find out where the command is in the args stream (the first arg not beginning with -) 2. Look up the command. 3. Build the relevant option parser. 4. Parse options and pass them off to the command.
Eric Seidel (no email)
Comment 2 2009-12-23 22:55:40 PST
WebKit Review Bot
Comment 3 2009-12-23 22:56:02 PST
style-queue ran check-webkit-style on attachment 45463 [details] without any errors.
Eric Seidel (no email)
Comment 4 2009-12-23 22:58:12 PST
Turns out a single option parser was not "easy", mostly because of how we depend on OptionParser for our help printing. If we re-wrote the help printing to not use OptionParser, this code would all probably be a lot simpler. Bleh. Ugly patch. I'm very glad we had unit test coverage of most of this though!
Adam Barth
Comment 5 2009-12-23 23:07:20 PST
Comment on attachment 45463 [details] Patch ok. set_option_parser is kind of goofy, but this looks like it should do the job.
WebKit Commit Bot
Comment 6 2009-12-23 23:18:36 PST
Comment on attachment 45463 [details] Patch Clearing flags on attachment: 45463 Committed r52543: <http://trac.webkit.org/changeset/52543>
WebKit Commit Bot
Comment 7 2009-12-23 23:18:43 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.