From 82d20869e1715af3859f1164b3869a506644b1f0 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 30 Jan 2020 14:57:40 +0000 Subject: [PATCH] actually use count (for best_count), dont +=1 spec arg for non-consume --- src/core_modules/command_spec.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core_modules/command_spec.py b/src/core_modules/command_spec.py index 90ada7ec..68313fd6 100644 --- a/src/core_modules/command_spec.py +++ b/src/core_modules/command_spec.py @@ -143,7 +143,8 @@ class Module(ModuleManager.BaseModule): current_error = None count = 0 - for i, spec_argument in enumerate(spec_arguments): + spec_index = 0 + for spec_argument in spec_arguments: argument_type_multi = len(set( t.type for t in spec_argument.types)) > 1 options = self._spec_value(server, kwargs["channel"], user, @@ -166,8 +167,10 @@ class Module(ModuleManager.BaseModule): else: value = None + count += 1 if spec_argument.consume: - out[i] = value + out[spec_index] = value + spec_index += 1 if argument_type: key = argument_type.name() or argument_type.type out[key] = value