2009-06-30 Simon Fraser <simon.fraser@apple.com>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jun 2009 21:47:44 +0000 (21:47 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jun 2009 21:47:44 +0000 (21:47 +0000)
        Reviewed by Mark Rowe.

        createBitmapContextFromWebView() incorrectly used #ifdef BUILDING_ON_LEOPARD,
        and thus failed on SnowLeopard.

        * DumpRenderTree/mac/PixelDumpSupportMac.mm:
        (createBitmapContextFromWebView):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@45401 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Scripts/bugzilla-tool

index b289e1c..0ddea60 100644 (file)
 
 2009-06-30  Eric Seidel  <eric@webkit.org>
 
+        Reviewed by Nikolas Zimmermann.
+
+        Make bugzilla tool print a message explaining how to get help on failure:
+        https://bugs.webkit.org/show_bug.cgi?id=26861
+
+        % bugzilla-tool
+        Usage: bugzilla-tool [options] command [command-options] [command-arguments]
+
+        bugzilla-tool: error: No command specified
+
+        Type 'bugzilla-tool --help' to see usage.
+
+        * Scripts/bugzilla-tool:
+
+2009-06-30  Eric Seidel  <eric@webkit.org>
+
         Reviewed by Maciej Stachowiak.
 
         Include a built copy of BeautifulSoup 3.1.0.1 so that
index 2536dfc..75a51b4 100755 (executable)
@@ -124,7 +124,7 @@ class Command:
         self.help_text = help_text
         self.argument_names = argument_names
         self.options = options
-        self.option_parser = OptionParser(usage=SUPPRESS_USAGE, add_help_option=False, option_list=self.options)
+        self.option_parser = HelpPrintingOptionParser(usage=SUPPRESS_USAGE, add_help_option=False, option_list=self.options)
     
     def name_with_arguments(self, command_name):
         usage_string = command_name
@@ -459,6 +459,13 @@ class NonWrappingEpilogIndentedHelpFormatter(IndentedHelpFormatter):
             return "\n" + epilog + "\n"
         return ""
 
+class HelpPrintingOptionParser(OptionParser):
+    def error(self, msg):
+        self.print_usage(sys.stderr)
+        error_message = "%s: error: %s\n" % (self.get_prog_name(), msg)
+        error_message += "\nType '" + self.get_prog_name() + " --help' to see usage.\n"
+        self.exit(2, error_message)
+
 class BugzillaTool:
     def __init__(self):
         self.cached_scm = None
@@ -476,7 +483,7 @@ class BugzillaTool:
             { 'name' : 'post-commits', 'object' : PostCommitsAsPatchesToBug() },
         ]
         
-        self.global_option_parser = OptionParser(usage=self.usage_line(), formatter=NonWrappingEpilogIndentedHelpFormatter(), epilog=self.commands_usage())
+        self.global_option_parser = HelpPrintingOptionParser(usage=self.usage_line(), formatter=NonWrappingEpilogIndentedHelpFormatter(), epilog=self.commands_usage())
         self.global_option_parser.add_option("--dry-run", action="store_true", dest="dryrun", help="do not touch remote servers", default=False)
     
     def scm(self):