summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorGiampaolo Lauria <lauria2@yahoo.com>2011-07-18 15:45:39 -0400
committerAndrew Tridgell <tridge@samba.org>2011-07-21 11:44:30 +1000
commitf03a059814ab757a112ea4504ffe8b933a905e3d (patch)
treea28e22a64005d5baafd33ec5f28bee33f66bb678 /source4/scripting
parenta2e2c130b0472c7d44d6e9d6e98b9f88853bef7b (diff)
downloadsamba-f03a059814ab757a112ea4504ffe8b933a905e3d.tar.gz
samba-f03a059814ab757a112ea4504ffe8b933a905e3d.tar.bz2
samba-f03a059814ab757a112ea4504ffe8b933a905e3d.zip
samba-tool: Improved --help functionality
Added a new --help msg Return an error when no subcommand is specified Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/netcmd/__init__.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/scripting/python/samba/netcmd/__init__.py b/source4/scripting/python/samba/netcmd/__init__.py
index 2d345df7b9..05ed321ef9 100644
--- a/source4/scripting/python/samba/netcmd/__init__.py
+++ b/source4/scripting/python/samba/netcmd/__init__.py
@@ -3,7 +3,7 @@
# Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2009
# Copyright (C) Theresa Halloran <theresahalloran@gmail.com> 2011
-# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
+# Copyright (C) Giampaolo Lauria <lauria2@yahoo.com> 2011
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -158,7 +158,11 @@ class SuperCommand(Command):
print "Available subcommands:"
for cmd in self.subcommands:
print "\t%-20s - %s" % (cmd, self.subcommands[cmd].description)
- if subcommand in [None, 'help', '-h', '--help' ]:
+ if subcommand in [None]:
+ self.show_command_error("You must specify a subcommand")
+ return -1
+ if subcommand in ['-h', '--help']:
+ print "For more help on a specific subcommand, please type: samba-tool %s <subcommand> (-h|--help)" % myname
return 0
self.show_command_error("No such subcommand '%s'" % (subcommand))