summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-10-08 12:45:20 +0200
committerStefan Metzmacher <metze@samba.org>2012-10-08 16:13:06 +0200
commit8d4943dcf943dc83b9b663d3d025fb1a8dbcba86 (patch)
treeeea55f1363dd08eed4a7479a331c1d1e5f112f64 /source4/scripting/python
parentc12cc3cf9c64ee0edd56875a5fb85e37129872ee (diff)
downloadsamba-8d4943dcf943dc83b9b663d3d025fb1a8dbcba86.tar.gz
samba-8d4943dcf943dc83b9b663d3d025fb1a8dbcba86.tar.bz2
samba-8d4943dcf943dc83b9b663d3d025fb1a8dbcba86.zip
s4:samba-tool: add optional epilog to _create_parser()
metze
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/netcmd/__init__.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/scripting/python/samba/netcmd/__init__.py b/source4/scripting/python/samba/netcmd/__init__.py
index ec2d22214d..677f4f0fc2 100644
--- a/source4/scripting/python/samba/netcmd/__init__.py
+++ b/source4/scripting/python/samba/netcmd/__init__.py
@@ -40,6 +40,11 @@ class PlainHelpFormatter(optparse.IndentedHelpFormatter):
result = "\n".join(wrapped_paragraphs) + "\n"
return result
+ def format_epilog(self, epilog):
+ if epilog:
+ return "\n" + epilog + "\n"
+ else:
+ return ""
class Command(object):
"""A samba-tool command."""
@@ -117,12 +122,12 @@ class Command(object):
if force_traceback or samba.get_debug_level() >= 3:
traceback.print_tb(etraceback)
- def _create_parser(self, prog):
+ def _create_parser(self, prog, epilog=None):
parser = optparse.OptionParser(
usage=self.synopsis,
description=self.full_description,
formatter=PlainHelpFormatter(),
- prog=prog)
+ prog=prog,epilog=epilog)
parser.add_options(self.takes_options)
optiongroups = {}
for name, optiongroup in self.takes_optiongroups.iteritems():