We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c5358cb + bfa06de commit dbd1adeCopy full SHA for dbd1ade
1 file changed
src/claimed/claimed.py
@@ -12,14 +12,22 @@ def _parse_kwargs(rest, sig):
12
while i < len(rest):
13
token = rest[i]
14
if token.startswith('--'):
15
- key = token[2:].replace('-', '_')
16
- if i + 1 < len(rest) and not rest[i + 1].startswith('--'):
17
- kwargs[key] = rest[i + 1]
18
- i += 2
19
- else:
20
- # bare flag → True
21
- kwargs[key] = True
+ body = token[2:]
+ # support both --key=value and --key value
+ if '=' in body:
+ raw_key, value = body.split('=', 1)
+ key = raw_key.replace('-', '_')
+ kwargs[key] = value
22
i += 1
+ else:
23
+ key = body.replace('-', '_')
24
+ if i + 1 < len(rest) and not rest[i + 1].startswith('--'):
25
+ kwargs[key] = rest[i + 1]
26
+ i += 2
27
28
+ # bare flag → True
29
+ kwargs[key] = True
30
+ i += 1
31
else:
32
33
0 commit comments