Changeset 52725 in webkit


Ignore:
Timestamp:
Jan 4, 2010 2:57:03 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-01-04 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

Need support for longer text in per-command help
https://bugs.webkit.org/show_bug.cgi?id=33143

Add some minimal additional help to land-diff and
pave the way for adding better help to all commands.

  • Scripts/webkitpy/commands/download.py: Add small amount of additional help to land-diff
  • Scripts/webkitpy/multicommandtool.py: support long_help
  • Scripts/webkitpy/multicommandtool_unittest.py: test long_help
Location:
trunk/WebKitTools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r52724 r52725  
     12010-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
    1152010-01-04  Adam Barth  <abarth@webkit.org>
    216
  • trunk/WebKitTools/Scripts/webkitpy/commands/download.py

    r52717 r52725  
    8181        steps.CloseBugForLandDiff,
    8282    ]
     83    long_help = """land-diff commits the current working copy diff (just as svn or git commit would).
     84land-diff will build and run the tests before committing.
     85If a bug id is provided, or one can be found in the ChangeLog land-diff will update the bug after committing."""
    8386
    8487    def _prepare_state(self, options, args, tool):
  • trunk/WebKitTools/Scripts/webkitpy/multicommandtool.py

    r52707 r52725  
    4343    name = None
    4444    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):
    4646        self.help_text = help_text
     47        self.long_help = long_help
    4748        self.argument_names = argument_names
    4849        self.required_arguments = self._parse_required_arguments(argument_names)
     
    113114
    114115    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
    116119        help_text += self.option_parser.format_option_help(IndentedHelpFormatter())
    117120        return help_text
     
    132135    help_text = None
    133136    argument_names = None
     137    long_help = None
    134138    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)
    136140
    137141
  • trunk/WebKitTools/Scripts/webkitpy/multicommandtool_unittest.py

    r52703 r52725  
    144144
    145145    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")
    147147        tool = TrivialTool(commands=[command_with_options])
    148         expected_subcommand_help = "trivial [options]   help text\nOptions:\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"
    149149        self._assert_tool_main_outputs(tool, ["tool", "help", "trivial"], expected_subcommand_help)
    150150
Note: See TracChangeset for help on using the changeset viewer.