mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #44542 from lozzd/patch-1
Clarify error for compound command arguments
This commit is contained in:
commit
c032439a0e
@ -2157,9 +2157,12 @@ class SaltCMDOptionParser(six.with_metaclass(OptionParserMeta,
|
||||
self.config['arg'].append([])
|
||||
else:
|
||||
self.config['arg'][cmd_index].append(arg)
|
||||
if len(self.config['fun']) != len(self.config['arg']):
|
||||
if len(self.config['fun']) > len(self.config['arg']):
|
||||
self.exit(42, 'Cannot execute compound command without '
|
||||
'defining all arguments.\n')
|
||||
elif len(self.config['fun']) < len(self.config['arg']):
|
||||
self.exit(42, 'Cannot execute compound command with more '
|
||||
'arguments than commands.\n')
|
||||
# parse the args and kwargs before sending to the publish
|
||||
# interface
|
||||
for i in range(len(self.config['arg'])):
|
||||
|
Loading…
Reference in New Issue
Block a user