MCPcopy Index your code
hub / github.com/python/cpython / _parse_args

Function _parse_args

Lib/platform.py:1400–1424  ·  view source on GitHub ↗
(args: list[str] | None)

Source from the content-addressed store, hash-verified

1398### Command line interface
1399
1400def _parse_args(args: list[str] | None):
1401 import argparse
1402
1403 parser = argparse.ArgumentParser(color=True)
1404 parser.add_argument("args", nargs="*", choices=["nonaliased", "terse"])
1405 parser.add_argument(
1406 "--terse",
1407 action="store_true",
1408 help=(
1409 "return only the absolute minimum information needed "
1410 "to identify the platform"
1411 ),
1412 )
1413 parser.add_argument(
1414 "--nonaliased",
1415 dest="aliased",
1416 action="store_false",
1417 help=(
1418 "disable system/OS name aliasing. If aliasing is enabled, "
1419 "some platforms report system names different from "
1420 "their common names, e.g. SunOS is reported as Solaris"
1421 ),
1422 )
1423
1424 return parser.parse_args(args)
1425
1426
1427def _main(args: list[str] | None = None):

Callers 1

_mainFunction · 0.70

Calls 2

parse_argsMethod · 0.95
add_argumentMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…