summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-12-28 21:07:25 +0100
committerJelmer Vernooij <jelmer@ganieda.vernstok.nl>2009-12-29 16:26:20 +0100
commite2c4d8281d726716a00cfe2e3e0352777fc8b66f (patch)
tree8ca4a0e53f30256a81ef4131db6fa66c80793a6e /source4/scripting/python
parent433f58f5a7490ba470dddc55e37325bb73cdba5c (diff)
downloadsamba-e2c4d8281d726716a00cfe2e3e0352777fc8b66f.tar.gz
samba-e2c4d8281d726716a00cfe2e3e0352777fc8b66f.tar.bz2
samba-e2c4d8281d726716a00cfe2e3e0352777fc8b66f.zip
s4/net: Allow options before arguments for Python commands.
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/netcmd/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/netcmd/__init__.py b/source4/scripting/python/samba/netcmd/__init__.py
index cb8fa01fe1..1a04210f95 100644
--- a/source4/scripting/python/samba/netcmd/__init__.py
+++ b/source4/scripting/python/samba/netcmd/__init__.py
@@ -75,12 +75,13 @@ class Command(object):
parser, optiongroups = self._create_parser()
opts, args = parser.parse_args(list(argv))
# Filter out options from option groups
+ args = args[1:]
kwargs = dict(opts.__dict__)
for option_group in parser.option_groups:
for option in option_group.option_list:
del kwargs[option.dest]
kwargs.update(optiongroups)
- if len(args) < len(self.takes_args):
+ if len(args) != len(self.takes_args):
self.usage(args)
return -1
try: