Public Member Functions | Public Attributes | List of all members
basis.argparse.ArgumentParser Class Reference
+ Inheritance diagram for basis.argparse.ArgumentParser:
+ Collaboration diagram for basis.argparse.ArgumentParser:

Public Member Functions

def __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)
 
def add_subparsers (self, kwargs)
 
def convert_arg_line_to_args (self, arg_line)
 
def error (self, message)
 
def exit (self, status=0, message=None)
 
def format_help (self)
 
def format_usage (self)
 
def format_version (self)
 
def parse_args (self, args=None, namespace=None)
 
def parse_known_args (self, args=None, namespace=None)
 
def print_help (self, file=None)
 
def print_usage (self, file=None)
 
def print_version (self, file=None)
 
- Public Member Functions inherited from basis.argparse._AttributeHolder
def __repr__ (self)
 
- Public Member Functions inherited from basis.argparse._ActionsContainer
def __init__ (self, description, prefix_chars, argument_default, conflict_handler)
 
def add_argument (self, args, kwargs)
 
def add_argument_group (self, args, kwargs)
 
def add_mutually_exclusive_group (self, kwargs)
 
def get_default (self, dest)
 
def register (self, registry_name, value, object)
 
def set_defaults (self, kwargs)
 

Public Attributes

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

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
    - 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 1559 of file argparse.py.

Constructor & Destructor Documentation

§ __init__()

def basis.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 1589 of file argparse.py.

Member Function Documentation

§ add_subparsers()

def basis.argparse.ArgumentParser.add_subparsers (   self,
  kwargs 
)

Definition at line 1673 of file argparse.py.

§ convert_arg_line_to_args()

def basis.argparse.ArgumentParser.convert_arg_line_to_args (   self,
  arg_line 
)

Definition at line 2038 of file argparse.py.

§ error()

def basis.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 2382 of file argparse.py.

§ exit()

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

Definition at line 2377 of file argparse.py.

§ format_help()

def basis.argparse.ArgumentParser.format_help (   self)

Definition at line 2311 of file argparse.py.

§ format_usage()

def basis.argparse.ArgumentParser.format_usage (   self)

Definition at line 2305 of file argparse.py.

§ format_version()

def basis.argparse.ArgumentParser.format_version (   self)

Definition at line 2334 of file argparse.py.

§ parse_args()

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

Definition at line 1724 of file argparse.py.

§ parse_known_args()

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

Definition at line 1731 of file argparse.py.

§ print_help()

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

Definition at line 2355 of file argparse.py.

§ print_usage()

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

Definition at line 2350 of file argparse.py.

§ print_version()

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

Definition at line 2360 of file argparse.py.

Member Data Documentation

§ add_help

basis.argparse.ArgumentParser.add_help

Definition at line 1615 of file argparse.py.

§ epilog

basis.argparse.ArgumentParser.epilog

Definition at line 1611 of file argparse.py.

§ formatter_class

basis.argparse.ArgumentParser.formatter_class

Definition at line 1613 of file argparse.py.

§ fromfile_prefix_chars

basis.argparse.ArgumentParser.fromfile_prefix_chars

Definition at line 1614 of file argparse.py.

§ prog

basis.argparse.ArgumentParser.prog

Definition at line 1609 of file argparse.py.

§ usage

basis.argparse.ArgumentParser.usage

Definition at line 1610 of file argparse.py.

§ version

basis.argparse.ArgumentParser.version

Definition at line 1612 of file argparse.py.


The documentation for this class was generated from the following file: