aboutsummaryrefslogtreecommitdiff
path: root/src/core_modules
diff options
context:
space:
mode:
authorGravatar jesopo2020-01-24 14:26:46 +0000
committerGravatar jesopo2020-01-24 14:27:47 +0000
commit52c3cab627526c2d82de14d0127398c9666d5da4 (patch)
tree79723d28987ec07880bd90c18e5c63a51e19952d /src/core_modules
parentfirst draft of command_spec.py (diff)
signature
still append None when an optional spec is missed
Diffstat (limited to 'src/core_modules')
-rw-r--r--src/core_modules/command_spec.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core_modules/command_spec.py b/src/core_modules/command_spec.py
index fbf5aa7e..36edf8ef 100644
--- a/src/core_modules/command_spec.py
+++ b/src/core_modules/command_spec.py
@@ -54,7 +54,7 @@ class Module(ModuleManager.BaseModule):
options = self._spec_chunk(server, channel, types, args)
- found = False
+ found = None
first_error = None
for type, chunk, n, error in options:
if error and not first_error:
@@ -65,7 +65,9 @@ class Module(ModuleManager.BaseModule):
args = args[n:]
if len(types) > 1:
chunk = [type, chunk]
- out.append(chunk)
+ found = chunk
+ break
+ out.append(found)
if not optional and not found:
error = first_error or "Invalid arguments"