示例#1
0
 def _create_service_parser(self, subcommand_table):
     """
     Creates the parser required to parse the commands on the
     command line
     """
     return ServiceArgParser(operations_table=subcommand_table,
                             service_name=self._name)
示例#2
0
 def _create_parser(self):
     # Also add a 'help' command.
     command_table = self._get_command_table()
     command_table['help'] = self.create_help_command()
     self.session.emit('building-command-table.%s' % self.name,
                       command_table=command_table)
     return ServiceArgParser(operations_table=command_table,
                             service_name=self.name)
 def _parse_service_operation(self, command, filename):
     try:
         command_parts = shlex.split(command)[1:]
     except Exception as e:
         raise AssertionError(
             "Failed to parse this example as shell command: %s\n\n"
             "Error:\n%s\n" % (command, e))
     # Strip off the 'aws ' part and break it out into a list.
     parsed_args, remaining = self._parse_next_command(
         filename, command, command_parts, self._main_parser)
     # We know the service is good.  Parse the operation.
     cmd = self._service_command_table[parsed_args.command]
     cmd_table = cmd.create_help_command().command_table
     service_parser = ServiceArgParser(operations_table=cmd_table,
                                       service_name=parsed_args.command)
     self._parse_next_command(filename, command, remaining, service_parser)
 def _create_parser(self):
     command_table = self._get_command_table()
     # Also add a 'help' command.
     command_table['help'] = self.create_help_command()
     return ServiceArgParser(operations_table=command_table,
                             service_name=self._name)
示例#5
0
 def _create_service_parser(self, operation_table):
     # TODO
     # Kind of kludgy that we have to use ServiceArgParser here.
     return ServiceArgParser(operations_table=operation_table,
                             service_name=self.name)