Home | Trees | Indices | Help |
---|
|
optparse.OptionContainer --+ | optparse.OptionParser --+ | CommandOptionParser
I parse options as usual, but I explicitly allow setting stdout so that our print_help() method (invoked by default with -h/--help) defaults to writing there.
I also override exit() so that I can be used in interactive shells.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from |
|
|||
_stdout = <epydoc.docintrospecter._DevNull object>
|
|||
__pychecker__ =
|
|||
Inherited from |
|
|||
help_printed = False whether help was printed during parsing |
|||
usage_printed = False whether usage was printed during parsing |
|
parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is an Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options.
|
print_help(file : file = stdout) Print an extended help message, listing all options and any help text provided with them, to 'file' (default stdout).
|
print_usage(file : file = stdout) Print the usage message for the current program (self.usage) to 'file' (default stdout). Any occurrence of the string "%prog" in self.usage is replaced with the name of the current program (basename of sys.argv[0]). Does nothing if self.usage is empty or not defined.
|
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Dec 15 23:15:28 2015 | http://epydoc.sourceforge.net |