diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 0fc0db4b..02d32199 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -963,6 +963,7 @@ def handle_call(goptions, session, args): usage = """\ usage: %prog call [options] [ ...] + values of the form NAME=VALUE are treated as keyword arguments Note, that you can use global option --noauth for anonymous calls here""" usage = textwrap.dedent(usage) parser = OptionParser(usage=get_usage_str(usage)) @@ -1016,11 +1017,14 @@ def handle_call(goptions, session, args): if options.kwargs: kw = parse_arg(options.kwargs) + kw_pat = re.compile(r'^([^\W0-9]\w*)=(.*)$') + # read the args non_kw = [] for arg in args[1:]: - if arg.find('=') != -1: - key, value = arg.split('=', 1) + m = kw_pat.match(arg) + if m: + key, value = m.groups() kw[key] = parse_arg(value) else: non_kw.append(parse_arg(arg)) diff --git a/tests/test_cli/test_call.py b/tests/test_cli/test_call.py index aca2ca37..727fefc2 100644 --- a/tests/test_cli/test_call.py +++ b/tests/test_cli/test_call.py @@ -22,6 +22,7 @@ class TestCall(utils.CliTestCase): self.activate_session_mock = mock.patch('koji_cli.commands.activate_session').start() self.error_format = """Usage: %s call [options] [ ...] + values of the form NAME=VALUE are treated as keyword arguments Note, that you can use global option --noauth for anonymous calls here (Specify the --help global option for a list of other help options) @@ -158,6 +159,7 @@ Note, that you can use global option --noauth for anonymous calls here handle_call, """Usage: %s call [options] [ ...] + values of the form NAME=VALUE are treated as keyword arguments Note, that you can use global option --noauth for anonymous calls here (Specify the --help global option for a list of other help options)