CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
argparse.ArgumentParser Class Reference
Inheritance diagram for argparse.ArgumentParser:
argparse._AttributeHolder argparse._ActionsContainer

Public Member Functions

def __init__
 
def add_subparsers
 
def error
 
def exit
 
def format_help
 
def format_usage
 
def format_version
 
def parse_args
 
def parse_known_args
 
def print_help
 
def print_usage
 
def print_version
 
- Public Member Functions inherited from argparse._AttributeHolder
def __repr__
 
- Public Member Functions inherited from argparse._ActionsContainer
def __init__
 
def add_argument
 
def add_argument_group
 
def add_mutually_exclusive_group
 
def register
 
def set_defaults
 

Public Attributes

 add_help
 
 epilog
 
 formatter_class
 
 fromfile_prefix_chars
 
 prog
 
 usage
 
 version
 
- Public Attributes inherited from argparse._ActionsContainer
 argument_default
 
 conflict_handler
 
 description
 
 prefix_chars
 

Private Member Functions

def _add_action
 
def _check_value
 
def _get_formatter
 
def _get_kwargs
 
def _get_nargs_pattern
 
def _get_option_tuples
 
def _get_optional_actions
 
def _get_positional_actions
 
def _get_value
 
def _get_values
 
def _match_argument
 
def _match_arguments_partial
 
def _parse_known_args
 
def _parse_optional
 
def _print_message
 
def _read_args_from_files
 

Private Attributes

 _optionals
 
 _positionals
 
 _subparsers
 

Detailed Description

Object for parsing command line strings into Python objects.

Keyword Arguments:
    - prog -- The name of the program (default: sys.argv[0])
    - usage -- A usage message (default: auto-generated from arguments)
    - description -- A description of what the program does
    - epilog -- Text following the argument descriptions
    - version -- Add a -v/--version option with the given version string
    - parents -- Parsers whose arguments should be copied into this one
    - formatter_class -- HelpFormatter class for printing help messages
    - prefix_chars -- Characters that prefix optional arguments
    - fromfile_prefix_chars -- Characters that prefix files containing
        additional arguments
    - argument_default -- The default value for all arguments
    - conflict_handler -- String indicating how to handle conflicts
    - add_help -- Add a -h/-help option

Definition at line 1503 of file argparse.py.

Constructor & Destructor Documentation

def argparse.ArgumentParser.__init__ (   self,
  prog = None,
  usage = None,
  description = None,
  epilog = None,
  version = None,
  parents = [],
  formatter_class = HelpFormatter,
  prefix_chars = '-',
  fromfile_prefix_chars = None,
  argument_default = None,
  conflict_handler = 'error',
  add_help = True 
)

Definition at line 1534 of file argparse.py.

Member Function Documentation

def argparse.ArgumentParser._add_action (   self,
  action 
)
private

Definition at line 1634 of file argparse.py.

def argparse.ArgumentParser._check_value (   self,
  action,
  value 
)
private

Definition at line 2187 of file argparse.py.

def argparse.ArgumentParser._get_formatter (   self)
private

Definition at line 2231 of file argparse.py.

def argparse.ArgumentParser._get_kwargs (   self)
private

Definition at line 1588 of file argparse.py.

def argparse.ArgumentParser._get_nargs_pattern (   self,
  action 
)
private

Definition at line 2082 of file argparse.py.

def argparse.ArgumentParser._get_option_tuples (   self,
  option_string 
)
private

Definition at line 2038 of file argparse.py.

def argparse.ArgumentParser._get_optional_actions (   self)
private

Definition at line 1641 of file argparse.py.

def argparse.ArgumentParser._get_positional_actions (   self)
private

Definition at line 1646 of file argparse.py.

def argparse.ArgumentParser._get_value (   self,
  action,
  arg_string 
)
private

Definition at line 2167 of file argparse.py.

def argparse.ArgumentParser._get_values (   self,
  action,
  arg_strings 
)
private

Definition at line 2122 of file argparse.py.

def argparse.ArgumentParser._match_argument (   self,
  action,
  arg_strings_pattern 
)
private

Definition at line 1953 of file argparse.py.

def argparse.ArgumentParser._match_arguments_partial (   self,
  actions,
  arg_strings_pattern 
)
private

Definition at line 1972 of file argparse.py.

def argparse.ArgumentParser._parse_known_args (   self,
  arg_strings,
  namespace 
)
private

Definition at line 1692 of file argparse.py.

def argparse.ArgumentParser._parse_optional (   self,
  arg_string 
)
private

Definition at line 1988 of file argparse.py.

def argparse.ArgumentParser._print_message (   self,
  message,
  file = None 
)
private

Definition at line 2246 of file argparse.py.

def argparse.ArgumentParser._read_args_from_files (   self,
  arg_strings 
)
private

Definition at line 1927 of file argparse.py.

def argparse.ArgumentParser.add_subparsers (   self,
  kwargs 
)

Definition at line 1603 of file argparse.py.

def argparse.ArgumentParser.error (   self,
  message 
)
error(message: string)

Prints a usage message incorporating the message to stderr and
exits.

If you override this in a subclass, it should not return -- it
should either exit or raise an exception.

Definition at line 2260 of file argparse.py.

def argparse.ArgumentParser.exit (   self,
  status = 0,
  message = None 
)

Definition at line 2255 of file argparse.py.

def argparse.ArgumentParser.format_help (   self)

Definition at line 2203 of file argparse.py.

def argparse.ArgumentParser.format_usage (   self)

Definition at line 2197 of file argparse.py.

def argparse.ArgumentParser.format_version (   self)

Definition at line 2226 of file argparse.py.

def argparse.ArgumentParser.parse_args (   self,
  args = None,
  namespace = None 
)

Definition at line 1654 of file argparse.py.

def argparse.ArgumentParser.parse_known_args (   self,
  args = None,
  namespace = None 
)

Definition at line 1661 of file argparse.py.

def argparse.ArgumentParser.print_help (   self,
  file = None 
)

Definition at line 2240 of file argparse.py.

def argparse.ArgumentParser.print_usage (   self,
  file = None 
)

Definition at line 2237 of file argparse.py.

def argparse.ArgumentParser.print_version (   self,
  file = None 
)

Definition at line 2243 of file argparse.py.

Member Data Documentation

argparse.ArgumentParser._optionals
private

Definition at line 1556 of file argparse.py.

argparse.ArgumentParser._positionals
private

Definition at line 1555 of file argparse.py.

argparse.ArgumentParser._subparsers
private

Definition at line 1557 of file argparse.py.

argparse.ArgumentParser.add_help

Definition at line 1552 of file argparse.py.

argparse.ArgumentParser.epilog

Definition at line 1548 of file argparse.py.

argparse.ArgumentParser.formatter_class

Definition at line 1550 of file argparse.py.

argparse.ArgumentParser.fromfile_prefix_chars

Definition at line 1551 of file argparse.py.

argparse.ArgumentParser.prog

Definition at line 1546 of file argparse.py.

argparse.ArgumentParser.usage

Definition at line 1547 of file argparse.py.

argparse.ArgumentParser.version

Definition at line 1549 of file argparse.py.