long_description and epilog should now be defined for each command.
Their string value will be printed whenever the user invokes the
command w/ the -h or --help
long_desciption will be printed after the usage statement.
epilog will be printed after the options are defined
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
# synopsis must be defined in all subclasses in order to provide the command usage
synopsis = ""
# synopsis must be defined in all subclasses in order to provide the command usage
synopsis = ""
+ # long_description is a string describing the command in details
+ long_description = ""
takes_args = []
takes_options = []
takes_optiongroups = {
takes_args = []
takes_options = []
takes_optiongroups = {
"credopts": options.CredentialsOptions,
"versionopts": options.VersionOptions,
}
"credopts": options.CredentialsOptions,
"versionopts": options.VersionOptions,
}
+ # This epilog will print at the end when the user invokes the command w/ -h or --help
+ epilog = ""
outf = sys.stdout
def usage(self, *args):
outf = sys.stdout
def usage(self, *args):
sys.exit(1)
def _create_parser(self):
sys.exit(1)
def _create_parser(self):
- parser = optparse.OptionParser(self.synopsis)
+ parser = optparse.OptionParser(usage=self.synopsis, epilog=self.epilog,
+ description=self.long_description)
parser.add_options(self.takes_options)
optiongroups = {}
for name, optiongroup in self.takes_optiongroups.iteritems():
parser.add_options(self.takes_options)
optiongroups = {}
for name, optiongroup in self.takes_optiongroups.iteritems():