Home | History | Annotate | Download | only in tool

Lines Matching refs:tool

35 from webkitpy.tool.multicommandtool import MultiCommandTool, Command, TryAgain
44 def execute(self, options, args, tool):
61 def execute(self, options, args, tool):
84 expected_missing_args_error = "2 arguments required, 1 argument provided. Provided: 'foo' Required: ARG1 ARG2\nSee 'trivial-tool help trivial' for usage.\n"
91 MultiCommandTool.__init__(self, name="trivial-tool", commands=commands)
120 tool = TrivialTool()
121 self.assertEqual(tool.command_by_name("trivial").name, "trivial")
122 self.assertEqual(tool.command_by_name("bar"), None)
124 def _assert_tool_main_outputs(self, tool, main_args, expected_stdout, expected_stderr = "", expected_exit_code=0):
125 exit_code = OutputCapture().assert_outputs(self, tool.main, [main_args], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
130 tool = TrivialTool(commands=[likes_to_retry])
131 tool.main(["tool", "likes-to-retry"])
135 tool = TrivialTool(commands=[TrivialCommand(), UncommonCommand()])
136 expected_common_commands_help = """Usage: trivial-tool [options] COMMAND [ARGS]
141 Common trivial-tool commands:
144 See 'trivial-tool help --all-commands' to list all commands.
145 See 'trivial-tool help COMMAND' for more information on a specific command.
148 self._assert_tool_main_outputs(tool, ["tool"], expected_common_commands_help)
149 self._assert_tool_main_outputs(tool, ["tool", "help"], expected_common_commands_help)
150 expected_all_commands_help = """Usage: trivial-tool [options] COMMAND [ARGS]
155 All trivial-tool commands:
160 See 'trivial-tool help --all-commands' to list all commands.
161 See 'trivial-tool help COMMAND' for more information on a specific command.
164 self._assert_tool_main_outputs(tool, ["tool", "help", "--all-commands"], expected_all_commands_help)
166 self._assert_tool_main_outputs(tool, ["tool", "--all-commands", "help"], expected_all_commands_help)
171 tool = TrivialTool(commands=[command_with_options])
173 self._assert_tool_main_outputs(tool, ["tool", "help", "trivial"], expected_subcommand_help)