Changeset 52725 in webkit
- Timestamp:
- Jan 4, 2010 2:57:03 AM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r52724 r52725 1 2010-01-04 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Need support for longer text in per-command help 6 https://bugs.webkit.org/show_bug.cgi?id=33143 7 8 Add some minimal additional help to land-diff and 9 pave the way for adding better help to all commands. 10 11 * Scripts/webkitpy/commands/download.py: Add small amount of additional help to land-diff 12 * Scripts/webkitpy/multicommandtool.py: support long_help 13 * Scripts/webkitpy/multicommandtool_unittest.py: test long_help 14 1 15 2010-01-04 Adam Barth <abarth@webkit.org> 2 16 -
trunk/WebKitTools/Scripts/webkitpy/commands/download.py
r52717 r52725 81 81 steps.CloseBugForLandDiff, 82 82 ] 83 long_help = """land-diff commits the current working copy diff (just as svn or git commit would). 84 land-diff will build and run the tests before committing. 85 If a bug id is provided, or one can be found in the ChangeLog land-diff will update the bug after committing.""" 83 86 84 87 def _prepare_state(self, options, args, tool): -
trunk/WebKitTools/Scripts/webkitpy/multicommandtool.py
r52707 r52725 43 43 name = None 44 44 show_in_main_help = False 45 def __init__(self, help_text, argument_names=None, options=None, requires_local_commits=False):45 def __init__(self, help_text, argument_names=None, options=None, long_help=None, requires_local_commits=False): 46 46 self.help_text = help_text 47 self.long_help = long_help 47 48 self.argument_names = argument_names 48 49 self.required_arguments = self._parse_required_arguments(argument_names) … … 113 114 114 115 def standalone_help(self): 115 help_text = self.name_with_arguments().ljust(len(self.name_with_arguments()) + 3) + self.help_text + "\n" 116 help_text = self.name_with_arguments().ljust(len(self.name_with_arguments()) + 3) + self.help_text + "\n\n" 117 if self.long_help: 118 help_text += "%s\n\n" % self.long_help 116 119 help_text += self.option_parser.format_option_help(IndentedHelpFormatter()) 117 120 return help_text … … 132 135 help_text = None 133 136 argument_names = None 137 long_help = None 134 138 def __init__(self, options=None, **kwargs): 135 Command.__init__(self, self.help_text, self.argument_names, options=options, **kwargs)139 Command.__init__(self, self.help_text, self.argument_names, options=options, long_help=self.long_help, **kwargs) 136 140 137 141 -
trunk/WebKitTools/Scripts/webkitpy/multicommandtool_unittest.py
r52703 r52725 144 144 145 145 def test_command_help(self): 146 command_with_options = TrivialCommand(options=[make_option("--my_option")] )146 command_with_options = TrivialCommand(options=[make_option("--my_option")], long_help="LONG HELP") 147 147 tool = TrivialTool(commands=[command_with_options]) 148 expected_subcommand_help = "trivial [options] help text\n Options:\n --my_option=MY_OPTION\n\n"148 expected_subcommand_help = "trivial [options] help text\n\nLONG HELP\n\nOptions:\n --my_option=MY_OPTION\n\n" 149 149 self._assert_tool_main_outputs(tool, ["tool", "help", "trivial"], expected_subcommand_help) 150 150
Note: See TracChangeset
for help on using the changeset viewer.