Object for parsing command line strings into Python objects. Keyword Arguments: - prog -- The name of the program (default: ``os.path.basename(sys.argv[0])``) - usage -- A usage message (default: auto-generated from arguments) - description -- A description o
| 1835 | |
| 1836 | |
| 1837 | class ArgumentParser(_AttributeHolder, _ActionsContainer): |
| 1838 | """Object for parsing command line strings into Python objects. |
| 1839 | |
| 1840 | Keyword Arguments: |
| 1841 | - prog -- The name of the program (default: |
| 1842 | ``os.path.basename(sys.argv[0])``) |
| 1843 | - usage -- A usage message (default: auto-generated from arguments) |
| 1844 | - description -- A description of what the program does |
| 1845 | - epilog -- Text following the argument descriptions |
| 1846 | - parents -- Parsers whose arguments should be copied into this one |
| 1847 | - formatter_class -- HelpFormatter class for printing help messages |
| 1848 | - prefix_chars -- Characters that prefix optional arguments |
| 1849 | - fromfile_prefix_chars -- Characters that prefix files containing |
| 1850 | additional arguments |
| 1851 | - argument_default -- The default value for all arguments |
| 1852 | - conflict_handler -- String indicating how to handle conflicts |
| 1853 | - add_help -- Add a -h/-help option |
| 1854 | - allow_abbrev -- Allow long options to be abbreviated unambiguously |
| 1855 | - exit_on_error -- Determines whether or not ArgumentParser exits with |
| 1856 | error info when an error occurs |
| 1857 | - suggest_on_error - Enables suggestions for mistyped argument choices |
| 1858 | and subparser names (default: ``False``) |
| 1859 | - color - Allow color output in help messages (default: ``False``) |
| 1860 | """ |
| 1861 | |
| 1862 | def __init__(self, |
| 1863 | prog=None, |
| 1864 | usage=None, |
| 1865 | description=None, |
| 1866 | epilog=None, |
| 1867 | parents=[], |
| 1868 | formatter_class=HelpFormatter, |
| 1869 | prefix_chars='-', |
| 1870 | fromfile_prefix_chars=None, |
| 1871 | argument_default=None, |
| 1872 | conflict_handler='error', |
| 1873 | add_help=True, |
| 1874 | allow_abbrev=True, |
| 1875 | exit_on_error=True, |
| 1876 | *, |
| 1877 | suggest_on_error=False, |
| 1878 | color=True, |
| 1879 | ): |
| 1880 | superinit = super(ArgumentParser, self).__init__ |
| 1881 | superinit(description=description, |
| 1882 | prefix_chars=prefix_chars, |
| 1883 | argument_default=argument_default, |
| 1884 | conflict_handler=conflict_handler) |
| 1885 | |
| 1886 | self.prog = _prog_name(prog) |
| 1887 | self.usage = usage |
| 1888 | self.epilog = epilog |
| 1889 | self.formatter_class = formatter_class |
| 1890 | self.fromfile_prefix_chars = fromfile_prefix_chars |
| 1891 | self.add_help = add_help |
| 1892 | self.allow_abbrev = allow_abbrev |
| 1893 | self.exit_on_error = exit_on_error |
| 1894 | self.suggest_on_error = suggest_on_error |
no outgoing calls
no test coverage detected