diff options
author | Giampaolo Lauria <lauria2@yahoo.com> | 2011-07-18 17:46:02 -0400 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-07-21 11:44:31 +1000 |
commit | 5f5eb1b00385fe1643dd5496c61954768fee3818 (patch) | |
tree | 93ba6e3e692ce3dd744fc2dd4b78aae2e6b6861c | |
parent | 452e50919efcd5d92df2bfad48ef106cd75ebad9 (diff) | |
download | samba-5f5eb1b00385fe1643dd5496c61954768fee3818.tar.gz samba-5f5eb1b00385fe1643dd5496c61954768fee3818.tar.bz2 samba-5f5eb1b00385fe1643dd5496c61954768fee3818.zip |
samba-tool: removed synopsis code in base class
As it is not always possible to determine the usage of a command solely based on the list of required and optional args, it is best
to have the subclasses always define it, rather than displaying an incorrect usage statement. Currently, all commands are subclassing the synopsis.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
-rw-r--r-- | source4/scripting/python/samba/netcmd/__init__.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/source4/scripting/python/samba/netcmd/__init__.py b/source4/scripting/python/samba/netcmd/__init__.py index e7ec1f7836..2de679d6f7 100644 --- a/source4/scripting/python/samba/netcmd/__init__.py +++ b/source4/scripting/python/samba/netcmd/__init__.py @@ -50,12 +50,6 @@ class Command(object): description = property(_get_description) - def _get_synopsis(self): - ret = self.name - if self.takes_args: - ret += " " + " ".join([x.upper() for x in self.takes_args]) - return ret - def show_command_error(self, e): '''display a command error''' if isinstance(e, CommandError): @@ -89,10 +83,10 @@ class Command(object): if force_traceback or samba.get_debug_level() >= 3: traceback.print_tb(etraceback) - synopsis = property(_get_synopsis) - outf = sys.stdout + # synopsis must be defined in all subclasses in order to provide the command usage + synopsis = "" takes_args = [] takes_options = [] takes_optiongroups = { |