Home
last modified time | relevance | path

Searched full:argparse (Results 1 – 25 of 3269) sorted by relevance

12345678910>>...131

/aosp_15_r20/external/python/absl-py/absl/flags/
Dargparse_flags.py15 """This module provides argparse integration with absl.flags.
18 :class:`argparse.ArgumentParser`. It takes care of collecting and defining absl
19 flags in :mod:`argparse`.
29 description='A demo of absl.flags and argparse integration.')
34 # argparse flag. The absl flag `--echo` continues to be available via
76 argparse parser. Notably:
93 import argparse
109 class ArgumentParser(argparse.ArgumentParser):
116 **kwargs: same as argparse.ArgumentParser, except:
133 # Now call super to initialize argparse.ArgumentParser before calling
[all …]
/aosp_15_r20/external/python/cpython3/Doc/library/
Dargparse.rst1 :mod:`argparse` --- Parser for command-line options, arguments and sub-commands
4 .. module:: argparse
12 **Source code:** :source:`Lib/argparse.py`
20 :ref:`argparse tutorial <argparse-tutorial>`.
22 The :mod:`argparse` module makes it easy to write user-friendly command-line
23 interfaces. The program defines what arguments it requires, and :mod:`argparse`
24 will figure out how to parse those out of :data:`sys.argv`. The :mod:`argparse`
32 The :mod:`argparse` module's support for command-line interfaces is built
33 around an instance of :class:`argparse.ArgumentParser`. It is a container for
36 parser = argparse.ArgumentParser(
[all …]
/aosp_15_r20/external/python/cpython2/Doc/library/
Dargparse.rst1 :mod:`argparse` --- Parser for command-line options, arguments and sub-commands
4 .. module:: argparse
11 **Source code:** :source:`Lib/argparse.py`
19 :ref:`argparse tutorial <argparse-tutorial>`.
21 The :mod:`argparse` module makes it easy to write user-friendly command-line
22 interfaces. The program defines what arguments it requires, and :mod:`argparse`
23 will figure out how to parse those out of :data:`sys.argv`. The :mod:`argparse`
34 import argparse
36 parser = argparse.ArgumentParser(description='Process some integers.')
88 The first step in using the :mod:`argparse` is creating an
[all …]
/aosp_15_r20/external/python/cpython3/Doc/howto/
Dargparse.rst4 Argparse Tutorial
9 .. currentmodule:: argparse
11 This tutorial is intended to be a gentle introduction to :mod:`argparse`, the
19 Note also that :mod:`argparse` is based on :mod:`optparse`,
76 import argparse
77 parser = argparse.ArgumentParser()
102 * The second one starts to display the usefulness of the :mod:`argparse`
116 import argparse
117 parser = argparse.ArgumentParser()
151 * The variable is some form of 'magic' that :mod:`argparse` performs for free
[all …]
/aosp_15_r20/external/python/cpython2/Doc/howto/
Dargparse.rst2 Argparse Tutorial
9 This tutorial is intended to be a gentle introduction to :mod:`argparse`, the
11 This was written for argparse in Python 3. A few details are different in 2.x,
19 Note also that :mod:`argparse` is based on :mod:`optparse`,
76 import argparse
77 parser = argparse.ArgumentParser()
102 * The second one starts to display the usefulness of the :mod:`argparse`
116 import argparse
117 parser = argparse.ArgumentParser()
151 * The variable is some form of 'magic' that :mod:`argparse` performs for free
[all …]
/aosp_15_r20/external/python/cpython3/Lib/test/
Dtest_argparse.py15 import argparse
43 parser = argparse.ArgumentParser()
46 mock.patch('argparse._sys.exit')
51 parser = argparse.ArgumentParser()
60 # argparse uses stderr as a fallback
63 mock.patch('argparse._sys.exit'),
172 class ErrorRaisingArgumentParser(argparse.ArgumentParser):
750 argument_signatures = [Sig('--foo', action=argparse.BooleanOptionalAction)]
762 parser = argparse.ArgumentParser()
764 parser.add_argument('--foo', const=True, action=argparse.BooleanOptionalAction)
[all …]
/aosp_15_r20/external/pigweed/pw_emu/py/pw_emu/
H A D__main__.py16 import argparse
35 def _cmd_gdb_cmds(emu, args: argparse.Namespace) -> None:
41 def _cmd_load(emu: Emulator, args: argparse.Namespace) -> None:
49 def _cmd_start(emu: Emulator, args: argparse.Namespace) -> None:
104 def _cmd_run(emu: Emulator, args: argparse.Namespace) -> None:
139 def _cmd_restart(emu: Emulator, args: argparse.Namespace) -> None:
147 def _cmd_stop(emu: Emulator, _args: argparse.Namespace) -> None:
153 def _cmd_reset(emu: Emulator, _args: argparse.Namespace) -> None:
159 def _cmd_gdb(emu: Emulator, args: argparse.Namespace) -> None:
176 def _cmd_prop_ls(emu: Emulator, args: argparse.Namespace) -> None:
[all …]
/aosp_15_r20/tools/acloud/create/
H A Dcreate_args.py19 import argparse
400 help=argparse.SUPPRESS)
409 help=argparse.SUPPRESS)
415 help=argparse.SUPPRESS)
421 help=argparse.SUPPRESS)
430 help=argparse.SUPPRESS)
436 help=argparse.SUPPRESS)
442 help=argparse.SUPPRESS)
448 help=argparse.SUPPRESS)
454 help=argparse.SUPPRESS)
[all …]
/aosp_15_r20/external/pigweed/pw_cli/py/pw_cli/
H A Darguments.py16 import argparse
37 def parse_args() -> argparse.Namespace:
51 """Transforms argparse actions into bash, fish, zsh shell completions."""
53 action: argparse.Action
54 parser: argparse.ArgumentParser
135 parser: argparse.ArgumentParser,
144 parser: argparse.ArgumentParser,
174 class _ArgumentParserWithBanner(argparse.ArgumentParser):
184 parser: argparse.ArgumentParser,
185 ) -> argparse.ArgumentParser:
[all …]
/aosp_15_r20/external/python/cpython2/Lib/test/
Dtest_argparse.py12 import argparse
129 class ErrorRaisingArgumentParser(argparse.ArgumentParser):
1294 Sig('foo', nargs='?', default=argparse.SUPPRESS),
1295 Sig('bar', nargs='*', default=argparse.SUPPRESS),
1296 Sig('--baz', action='store_true', default=argparse.SUPPRESS),
1312 parser_signature = Sig(argument_default=argparse.SUPPRESS)
1422 type = argparse.FileType('r')
1426 type = argparse.FileType('wb', 1)
1461 Sig('-x', type=argparse.FileType()),
1462 Sig('spam', type=argparse.FileType('r')),
[all …]
/aosp_15_r20/system/extras/perf2cfg/
H A Dperf2cfg.py22 import argparse
32 def parse_arguments() -> argparse.Namespace:
36 argparse.Namespace: A populated argument namespace.
38 parser = argparse.ArgumentParser(
39 # Hardcode the usage string as argparse does not display long options
60 default=argparse.SUPPRESS,
86 def analyze_record_files(args: argparse.Namespace) -> analyze.RecordAnalyzer:
90 args (argparse.Namespace): An argument namespace.
103 args: argparse.Namespace) -> None:
108 args (argparse.Namespace): An argument namespace.
[all …]
/aosp_15_r20/external/pigweed/pw_protobuf_compiler/py/pw_protobuf_compiler/
H A Dgenerate_protos.py16 import argparse
35 def _argument_parser() -> argparse.ArgumentParser:
38 parser = argparse.ArgumentParser(description=__doc__)
57 type=argparse.FileType('r'),
122 def protoc_common_args(args: argparse.Namespace) -> tuple[str, ...]:
132 args: argparse.Namespace, include_paths: list[str]
161 args: argparse.Namespace, _include_paths: list[str]
172 args: argparse.Namespace, _include_paths: list[str]
181 args: argparse.Namespace, _include_paths: list[str]
197 args: argparse.Namespace, _include_paths: list[str]
[all …]
/aosp_15_r20/external/pigweed/pw_system/py/pw_system/
H A Dconsole.py34 import argparse
77 parser: argparse.ArgumentParser,
78 ) -> argparse.ArgumentParser:
85 raise argparse.ArgumentTypeError(
142 action=argparse.BooleanOptionalAction,
148 action=argparse.BooleanOptionalAction,
157 parser: argparse.ArgumentParser,
158 ) -> argparse.ArgumentParser:
174 def get_parser() -> argparse.ArgumentParser:
175 """Build pw_system.console argparse with both device and logfile args."""
[all …]
/aosp_15_r20/external/autotest/utils/frozen_chromite/lib/
H A Dcommandline.py14 import argparse
109 # message in the exception is useless because argparse ignores the
159 # message in the exception is useless because argparse ignores the
197 """Parses devices as an argparse argument type.
220 parser = argparse.ArgumentParser()
242 # Provide __name__ for argparse to print on failure, or else it will use
250 but argparse expects a parsing function, so we overload __call__() for
251 argparse to use.
269 # argparse ignores exception messages, so print the message manually.
401 class _AppendOption(argparse.Action):
[all …]
/aosp_15_r20/external/pigweed/pw_presubmit/py/pw_presubmit/
H A Dcli.py16 import argparse
89 parser: argparse.ArgumentParser, programs: presubmit.Programs, default: str
94 raise argparse.ArgumentTypeError(
101 # This argument is used to copy the default program into the argparse
106 help=argparse.SUPPRESS,
123 help=argparse.SUPPRESS,
153 raise argparse.ArgumentTypeError(
194 help=argparse.SUPPRESS,
199 parser: argparse.ArgumentParser,
269 help=argparse.SUPPRESS,
[all …]
/aosp_15_r20/external/pigweed/pw_build/py/pw_build/
H A Dproject_builder_prefs.py16 import argparse
104 [argparse.ArgumentParser], argparse.ArgumentParser
107 parser = argparse.ArgumentParser(
108 description='', formatter_class=argparse.RawDescriptionHelpFormatter
124 [argparse.ArgumentParser], argparse.ArgumentParser
144 # Get the config defined by argparse defaults.
175 def apply_command_line_args(self, new_args: argparse.Namespace) -> None:
176 """Update the stored config with an argparse namespace."""
254 # build_dir should be a list of strings from argparse
H A Dexec.py16 import argparse
35 parser: argparse.ArgumentParser | None = None,
36 ) -> argparse.ArgumentParser:
40 parser = argparse.ArgumentParser(description=__doc__)
44 type=argparse.FileType('r'),
61 type=argparse.FileType('r'),
80 nargs=argparse.REMAINDER,
122 # the various spaces in the command which means when argparse
123 # gets the string argparse believes this as a single argument
/aosp_15_r20/external/pigweed/pw_build/py/
H A Dproject_builder_prefs_test.py16 import argparse
76 # Argparse input
108 # Argparse input
125 # Argparse input
140 # Argparse input
171 # Argparse input
186 # Argparse input
202 # Argparse input
256 parser = argparse.ArgumentParser(
257 formatter_class=argparse.RawDescriptionHelpFormatter,
/aosp_15_r20/external/pigweed/pw_tokenizer/py/pw_tokenizer/
H A Ddatabase.py21 import argparse
415 class ExpandGlobs(argparse.Action):
416 """Argparse action that expands and appends paths."""
468 class LoadTokenDatabases(argparse.Action):
469 """Argparse action that reads tokenize databases from paths or globs.
489 def token_databases_parser(nargs: str = '+') -> argparse.ArgumentParser:
494 parser = argparse.ArgumentParser(add_help=False)
512 def _parse_args() -> tuple[Callable[..., None], argparse.Namespace]:
524 option_db = argparse.ArgumentParser(add_help=False)
537 parser = argparse.ArgumentParser(
[all …]
/aosp_15_r20/external/cronet/testing/unexpected_passes_common/
H A Dargument_parsing.py6 import argparse
13 def AddCommonArguments(parser: argparse.ArgumentParser) -> None:
17 parser: An argparse.ArgumentParser instance to add arguments to.
122 def PerformCommonPostParseSetup(args: argparse.Namespace) -> None:
126 args: Parsed arguments from an argparse.ArgumentParser.
132 def SetLoggingVerbosity(args: argparse.Namespace) -> None:
136 args: Parsed arguments from an argparse.ArgumentParser.
152 def SetInternalBuilderInclusion(args: argparse.Namespace) -> None:
156 args: Parsed arguments from an argparse.ArgumentParser.
/aosp_15_r20/external/selinux/python/sepolicy/
H A Dsepolicy.py30 import argparse
54 class CheckPath(argparse.Action):
62 class CheckType(argparse.Action):
77 class CheckBoolean(argparse.Action):
100 class CheckDomain(argparse.Action):
125 class CheckClass(argparse.Action):
137 class CheckAdmin(argparse.Action):
151 class CheckPort(argparse.Action):
164 class CheckPortType(argparse.Action):
179 class LoadPolicy(argparse.Action):
[all …]
/aosp_15_r20/external/pigweed/pw_software_update/py/pw_software_update/
H A Dcli.py23 import argparse
83 return argparse.HelpFormatter(prog, max_help_position=100, width=200)
116 return argparse.HelpFormatter(prog, max_help_position=100, width=200)
211 return argparse.HelpFormatter(prog, max_help_position=100, width=200)
266 return argparse.HelpFormatter(prog, max_help_position=100, width=200)
313 return argparse.HelpFormatter(prog, max_help_position=100, width=200)
362 return argparse.HelpFormatter(prog, max_help_position=100, width=200)
397 return argparse.HelpFormatter(prog, max_help_position=100, width=200)
446 return argparse.HelpFormatter(prog, max_help_position=100, width=200)
516 def _parse_args() -> argparse.Namespace:
[all …]
/aosp_15_r20/external/pigweed/pw_rpc/py/pw_rpc/
H A Dtesting.py16 import argparse
28 parser: argparse.ArgumentParser | None = None,
29 ) -> argparse.Namespace:
32 parser = argparse.ArgumentParser(
53 nargs=argparse.REMAINDER,
68 def _parse_subprocess_integration_test_args() -> argparse.Namespace:
69 parser = argparse.ArgumentParser(
91 nargs=argparse.REMAINDER,
/aosp_15_r20/external/cronet/testing/merge_scripts/
H A Dmerge_api.py5 import argparse
13 parser = argparse.ArgumentParser(*args, **kwargs)
14 parser.add_argument('--build-properties', help=argparse.SUPPRESS)
15 parser.add_argument('--summary-json', help=argparse.SUPPRESS)
16 parser.add_argument('--task-output-dir', help=argparse.SUPPRESS)
18 help=argparse.SUPPRESS)
19 parser.add_argument('jsons_to_merge', nargs='*', help=argparse.SUPPRESS)
/aosp_15_r20/external/webrtc/tools_webrtc/perf/
H A Dprocess_perf_results.py21 import argparse
102 parser = argparse.ArgumentParser()
103 parser.add_argument('--build-properties', help=argparse.SUPPRESS)
104 parser.add_argument('--summary-json', help=argparse.SUPPRESS)
105 parser.add_argument('--task-output-dir', help=argparse.SUPPRESS)
106 parser.add_argument('--test-suite', help=argparse.SUPPRESS)
107 parser.add_argument('-o', '--output-json', help=argparse.SUPPRESS)
108 parser.add_argument('json_files', nargs='*', help=argparse.SUPPRESS)

12345678910>>...131