Logo Search packages:      
Sourcecode: jhbuild version File versions  Download package

jhbuild::cut_n_paste::optparse::OptionParser Class Reference

Inheritance diagram for jhbuild::cut_n_paste::optparse::OptionParser:

jhbuild::cut_n_paste::optparse::OptionContainer

List of all members.


Detailed Description

Class attributes:
  standard_option_list : [Option]
    list of standard options that will be accepted by all instances
    of this parser class (intended to be overridden by subclasses).

Instance attributes:
  usage : string
    a usage string for your program.  Before it is displayed
    to the user, "%prog" will be expanded to the name of
    your program (self.prog or os.path.basename(sys.argv[0])).
  prog : string
    the name of the current program (to override
    os.path.basename(sys.argv[0])).
  epilog : string
    paragraph of help text to print after option help

  option_groups : [OptionGroup]
    list of option groups in this parser (option groups are
    irrelevant for parsing the command-line, but very useful
    for generating help)

  allow_interspersed_args : bool = true
    if true, positional arguments may be interspersed with options.
    Assuming -a and -b each take a single argument, the command-line
      -ablah foo bar -bboo baz
    will be interpreted the same as
      -ablah -bboo -- foo bar baz
    If this flag were false, that command line would be interpreted as
      -ablah -- foo bar -bboo baz
    -- ie. we stop processing options as soon as we see the first
    non-option argument.  (This is the tradition followed by
    Python's getopt module, Perl's Getopt::Std, and other argument-
    parsing libraries, but it is generally annoying to users.)

  process_default_values : bool = true
    if true, option default values are processed similarly to option
    values from the command line: that is, they are passed to the
    type-checking function for the option's type (as long as the
    default value is a string).  (This really only matters if you
    have defined custom types; see SF bug #955889.)  Set it to false
    to restore the behaviour of Optik 1.4.1 and earlier.

  rargs : [string]
    the argument list currently being parsed.  Only set when
    parse_args() is active, and continually trimmed down as
    we consume arguments.  Mainly there for the benefit of
    callback options.
  largs : [string]
    the list of leftover arguments that we have skipped while
    parsing options.  If allow_interspersed_args is false, this
    list is always empty.
  values : Values
    the set of option values currently being accumulated.  Only
    set when parse_args() is active.  Also mainly for callbacks.

Because of the 'rargs', 'largs', and 'values' attributes,
OptionParser is not thread-safe.  If, for some perverse reason, you
need to parse command-line arguments simultaneously in different
threads, use different OptionParser instances.

Definition at line 1110 of file optparse.py.


Public Member Functions

def __init__
def __init__
def add_option
def add_option_group
def add_options
def check_values
def destroy
def disable_interspersed_args
def enable_interspersed_args
def error
def exit
def expand_prog_name
def format_description
def format_epilog
def format_help
def format_option_help
def get_default_values
def get_description
def get_option
def get_option_group
def get_prog_name
def get_usage
def get_version
def has_option
def parse_args
def print_help
def print_usage
def print_version
def remove_option
def set_conflict_handler
def set_default
def set_defaults
def set_description
def set_process_default_values
def set_usage

Public Attributes

 allow_interspersed_args
 conflict_handler
 defaults
 description
 epilog
 formatter
 largs
 option_class
 option_groups
 option_list
 process_default_values
 prog
 rargs
 usage
 values
 version

Static Public Attributes

list standard_option_list = []

Private Member Functions

def _add_help_option
def _add_version_option
def _create_option_list
def _get_all_options
def _get_args
def _init_parsing_state
def _match_long_opt
def _populate_option_list
def _process_args
def _process_long_opt
def _process_short_opts

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

Generated by  Doxygen 1.6.0   Back to index