b.o.Option(object) : class documentation

Part of bzrlib.option View In Hierarchy

Known subclasses: bzrlib.option.ListOption, bzrlib.option.RegistryOption

Description of a command line option

:ivar _short_name: If this option has a single-letter name, this is it.
Otherwise None.
Method __init__ Make a new command option.
Method short_name Undocumented
Method set_short_name Undocumented
Method get_negation_name Undocumented
Method add_option Add this option to an Optparse parser
Method iter_switches Iterate through the list of switches provided by the option
Method is_hidden Undocumented
Method _optparse_bool_callback Undocumented
Method _optparse_callback Undocumented
def __init__(self, name, help='', type=None, argname=None, short_name=None, param_name=None, custom_callback=None, hidden=False):
Make a new command option.
Parametersnameregular name of the command, used in the double-dash form and also as the parameter to the command's run() method (unless param_name is specified).
helphelp message displayed in command help
typefunction called to parse the option argument, or None (default) if this option doesn't take an argument.
argnamename of option argument, if any
short_nameshort option code for use with a single -, e.g. short_name="v" to enable parsing of -v.
param_namename of the parameter which will be passed to the command's run() method.
custom_callbacka callback routine to be called after normal processing. The signature of the callback routine is (option, name, new_value, parser).
hiddenIf True, the option should be hidden in help and documentation.
def short_name(self):
Undocumented
def set_short_name(self, short_name):
Undocumented
def get_negation_name(self):
Undocumented
def add_option(self, parser, short_name):
Add this option to an Optparse parser
def _optparse_bool_callback(self, option, opt_str, value, parser, bool_v):
Undocumented
def _optparse_callback(self, option, opt, value, parser):
Undocumented
def iter_switches(self):
Iterate through the list of switches provided by the option
Returnsan iterator of (name, short_name, argname, help)
def is_hidden(self, name):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.