mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
s4:samba-tool: add optional epilog to _create_parser()
metze
This commit is contained in:
@ -40,6 +40,11 @@ class PlainHelpFormatter(optparse.IndentedHelpFormatter):
|
|||||||
result = "\n".join(wrapped_paragraphs) + "\n"
|
result = "\n".join(wrapped_paragraphs) + "\n"
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def format_epilog(self, epilog):
|
||||||
|
if epilog:
|
||||||
|
return "\n" + epilog + "\n"
|
||||||
|
else:
|
||||||
|
return ""
|
||||||
|
|
||||||
class Command(object):
|
class Command(object):
|
||||||
"""A samba-tool command."""
|
"""A samba-tool command."""
|
||||||
@ -117,12 +122,12 @@ class Command(object):
|
|||||||
if force_traceback or samba.get_debug_level() >= 3:
|
if force_traceback or samba.get_debug_level() >= 3:
|
||||||
traceback.print_tb(etraceback)
|
traceback.print_tb(etraceback)
|
||||||
|
|
||||||
def _create_parser(self, prog):
|
def _create_parser(self, prog, epilog=None):
|
||||||
parser = optparse.OptionParser(
|
parser = optparse.OptionParser(
|
||||||
usage=self.synopsis,
|
usage=self.synopsis,
|
||||||
description=self.full_description,
|
description=self.full_description,
|
||||||
formatter=PlainHelpFormatter(),
|
formatter=PlainHelpFormatter(),
|
||||||
prog=prog)
|
prog=prog,epilog=epilog)
|
||||||
parser.add_options(self.takes_options)
|
parser.add_options(self.takes_options)
|
||||||
optiongroups = {}
|
optiongroups = {}
|
||||||
for name, optiongroup in self.takes_optiongroups.iteritems():
|
for name, optiongroup in self.takes_optiongroups.iteritems():
|
||||||
|
Reference in New Issue
Block a user