| OLD | NEW |
| 1 # Copyright (c) 2009 Google Inc. All rights reserved. | 1 # Copyright (c) 2009 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 import unittest | 29 import unittest |
| 30 | 30 |
| 31 from optparse import make_option | 31 from optparse import make_option |
| 32 | 32 |
| 33 from webkitpy.common.system.outputcapture import OutputCapture | 33 from webkitpy.common.system.outputcapture import OutputCapture |
| 34 from webkitpy.tool.multicommandtool import MultiCommandTool, TryAgain | 34 from webkitpy.tool.multicommandtool import MultiCommandTool, TryAgain |
| 35 from webkitpy.tool.commands import Command | 35 from webkitpy.tool.commands.command import Command |
| 36 | 36 |
| 37 | 37 |
| 38 class TrivialCommand(Command): | 38 class TrivialCommand(Command): |
| 39 name = "trivial" | 39 name = "trivial" |
| 40 help_text = "help text" | 40 help_text = "help text" |
| 41 long_help = "trivial command long help text" | 41 long_help = "trivial command long help text" |
| 42 show_in_main_help = True | 42 show_in_main_help = True |
| 43 | 43 |
| 44 def __init__(self, **kwargs): | 44 def __init__(self, **kwargs): |
| 45 super(TrivialCommand, self).__init__(**kwargs) | 45 super(TrivialCommand, self).__init__(**kwargs) |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 tool = TrivialTool(commands=[command_with_options]) | 155 tool = TrivialTool(commands=[command_with_options]) |
| 156 expected_subcommand_help = """trivial [options] help text | 156 expected_subcommand_help = """trivial [options] help text |
| 157 | 157 |
| 158 trivial command long help text | 158 trivial command long help text |
| 159 | 159 |
| 160 Options: | 160 Options: |
| 161 --my_option=MY_OPTION | 161 --my_option=MY_OPTION |
| 162 | 162 |
| 163 """ | 163 """ |
| 164 self._assert_tool_main_outputs(tool, ["tool", "help", "trivial"], expect
ed_subcommand_help) | 164 self._assert_tool_main_outputs(tool, ["tool", "help", "trivial"], expect
ed_subcommand_help) |
| OLD | NEW |