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.
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.
Created attachment 45463 [details] Patch
style-queue ran check-webkit-style on attachment 45463 [details] without any errors.
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!
Comment on attachment 45463 [details] Patch ok. set_option_parser is kind of goofy, but this looks like it should do the job.
Comment on attachment 45463 [details] Patch Clearing flags on attachment: 45463 Committed r52543: <http://trac.webkit.org/changeset/52543>
All reviewed patches have been landed. Closing bug.