MCPcopy Index your code
hub / github.com/aws/aws-cli / MainArgParser

Class MainArgParser

awscli/argparser.py:119–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117
118
119class MainArgParser(CLIArgParser):
120 Formatter = argparse.RawTextHelpFormatter
121
122 def __init__(
123 self,
124 command_table,
125 version_string,
126 description,
127 argument_table,
128 prog=None,
129 ):
130 super().__init__(
131 formatter_class=self.Formatter,
132 add_help=False,
133 conflict_handler='resolve',
134 description=description,
135 usage=USAGE,
136 prog=prog,
137 )
138 self._build(command_table, version_string, argument_table)
139
140 def _create_choice_help(self, choices):
141 help_str = ''
142 for choice in sorted(choices):
143 help_str += f'* {choice}\n'
144 return help_str
145
146 def _build(self, command_table, version_string, argument_table):
147 for argument_name in argument_table:
148 argument = argument_table[argument_name]
149 argument.add_to_parser(self)
150 self.add_argument(
151 '--version',
152 action="version",
153 version=version_string,
154 help='Display the version of this tool',
155 )
156 self.add_argument(
157 'command', action=CommandAction, command_table=command_table
158 )
159
160
161class ServiceArgParser(CLIArgParser):

Callers 5

setUpMethod · 0.90
setUpMethod · 0.90
create_parserMethod · 0.90
__init__Method · 0.90
create_parserMethod · 0.90

Calls

no outgoing calls

Tested by 4

setUpMethod · 0.72
setUpMethod · 0.72
create_parserMethod · 0.72
__init__Method · 0.72