Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/help_command.py

Issue 2385373003: Fix webkit-patch --help. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/help_command.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/help_command.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/help_command.py
index 9f8d1b907d9b341ddbcd42cf90d631f3f8e81d2b..625f0bfd4cb941d8b2e41dc41f3dc83e3d075f91 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/help_command.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/help_command.py
@@ -36,7 +36,7 @@ class HelpCommand(Command):
help_text = "Display information about this program or its subcommands"
argument_names = "[COMMAND]"
- def __init__(self):
+ def __init__(self, tool=None):
options = [
optparse.make_option(
"-a",
@@ -46,11 +46,12 @@ class HelpCommand(Command):
help="Print all available commands"),
]
super(HelpCommand, self).__init__(options)
- # A hack used to pass --all-commands to _help_epilog even though it's called by the OptionParser.
+ # A hack used to pass --all-commands to help_epilog even though it's called by the OptionParser.
self.show_all_commands = False
- self._tool = None
+ # self._tool is used in help_epilog, so it's passed in the initializer rather than set in the execute method.
+ self._tool = tool
- def _help_epilog(self):
+ def help_epilog(self):
# Only show commands which are relevant to this checkout's SCM system. Might this be confusing to some users?
if self.show_all_commands:
epilog = "All %prog commands:\n"
@@ -73,7 +74,6 @@ class HelpCommand(Command):
self.option_parser.remove_option(option.get_opt_string())
def execute(self, options, args, tool):
- self._tool = tool
if args:
command = self._tool.command_by_name(args[0])
if command:
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698