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

Function parse_args

Lib/webbrowser.py:733–750  ·  view source on GitHub ↗
(arg_list: list[str] | None)

Source from the content-addressed store, hash-verified

731
732
733def parse_args(arg_list: list[str] | None):
734 import argparse
735 parser = argparse.ArgumentParser(
736 description="Open URL in a web browser.", color=True,
737 )
738 parser.add_argument("url", help="URL to open")
739
740 group = parser.add_mutually_exclusive_group()
741 group.add_argument("-n", "--new-window", action="store_const",
742 const=1, default=0, dest="new_win",
743 help="open new window")
744 group.add_argument("-t", "--new-tab", action="store_const",
745 const=2, default=0, dest="new_win",
746 help="open new tab")
747
748 args = parser.parse_args(arg_list)
749
750 return args
751
752
753def main(arg_list: list[str] | None = None):

Callers 1

mainFunction · 0.70

Calls 3

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…