strictcli 0.1.0__tar.gz → 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/hashes.json +1 -1
- strictcli-0.1.1/.rlsbl/version +1 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/CHANGELOG.md +4 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/PKG-INFO +1 -1
- {strictcli-0.1.0 → strictcli-0.1.1}/package-lock.json +2 -2
- {strictcli-0.1.0 → strictcli-0.1.1}/package.json +1 -1
- {strictcli-0.1.0 → strictcli-0.1.1}/pyproject.toml +1 -1
- {strictcli-0.1.0 → strictcli-0.1.1}/strictcli/__init__.py +2 -2
- {strictcli-0.1.0 → strictcli-0.1.1}/tests/test_parser.py +20 -0
- strictcli-0.1.0/.rlsbl/version +0 -1
- {strictcli-0.1.0 → strictcli-0.1.1}/.claude/settings.json +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.github/workflows/ci.yml +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.github/workflows/publish.yml +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.gitignore +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/.claude/settings.json +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/.github/workflows/ci.yml +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/.github/workflows/publish.yml +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/.gitignore +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/.rlsbl/hooks/post-release.sh +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/.rlsbl/hooks/pre-release.sh +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/CHANGELOG.md +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/CLAUDE.md +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/LICENSE +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/config.json +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/hooks/post-release.sh +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/hooks/pre-release.sh +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/CLAUDE.md +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/LICENSE +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/README.md +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/index.js +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/postinstall.js +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/tests/test_e2e.py +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/tests/test_env.py +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/tests/test_help.py +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/tests/test_nesting.py +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/tests/test_registration.py +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/tests/test_tags.py +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/todo/.done/original-idea.md +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/todo/deferred.md +0 -0
- {strictcli-0.1.0 → strictcli-0.1.1}/uv.lock +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
".github/workflows/ci.yml": "
|
|
2
|
+
".github/workflows/ci.yml": "d1da13d13914be16b2ecafe67afc62d611dc8dcc4ebc9db2befd84c2d6296ab2",
|
|
3
3
|
".github/workflows/publish.yml": "5f4ac1bf0bdd4c70041e3d2502efaae28d29eca7575e8ff12fdaad0d3af5b17a",
|
|
4
4
|
"CHANGELOG.md": "7a6ec46141007c18090a0ff325e2dd68cd51588c4e0b5af7b580365e5eaaca85",
|
|
5
5
|
".gitignore": "c89d76c6c43e7f0897b3472a15b7c0103e0be5b3a04c2b44e585fa48bdcda2bb",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.22.1
|
|
@@ -373,7 +373,7 @@ def _parse_command(cmd: Command, tokens: list[str]) -> tuple[Command, dict[str,
|
|
|
373
373
|
i += 1
|
|
374
374
|
else:
|
|
375
375
|
# str flag: consume next token as value
|
|
376
|
-
if i + 1 < len(tokens)
|
|
376
|
+
if i + 1 < len(tokens):
|
|
377
377
|
cli_set[f.name] = tokens[i + 1]
|
|
378
378
|
i += 2
|
|
379
379
|
else:
|
|
@@ -391,7 +391,7 @@ def _parse_command(cmd: Command, tokens: list[str]) -> tuple[Command, dict[str,
|
|
|
391
391
|
i += 1
|
|
392
392
|
else:
|
|
393
393
|
# str flag: consume next token as value
|
|
394
|
-
if i + 1 < len(tokens)
|
|
394
|
+
if i + 1 < len(tokens):
|
|
395
395
|
cli_set[f.name] = tokens[i + 1]
|
|
396
396
|
i += 2
|
|
397
397
|
else:
|
|
@@ -176,3 +176,23 @@ def test_required_str_flag_via_equals():
|
|
|
176
176
|
r = app.test(["cmd", "--target=hello"])
|
|
177
177
|
assert r.exit_code == 0
|
|
178
178
|
assert "target=hello" in r.stdout
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def test_str_flag_value_starting_with_hyphen():
|
|
182
|
+
"""Str flag accepts a value that starts with a hyphen (e.g. --offset -5)."""
|
|
183
|
+
app = strictcli.App(name="test", version="1.0.0", help="test app")
|
|
184
|
+
|
|
185
|
+
@app.command("cmd", help="a command")
|
|
186
|
+
@strictcli.flag("offset", short="o", type=str, help="the offset")
|
|
187
|
+
def cmd(offset):
|
|
188
|
+
print(f"offset={offset}")
|
|
189
|
+
|
|
190
|
+
# Long flag form
|
|
191
|
+
r = app.test(["cmd", "--offset", "-5"])
|
|
192
|
+
assert r.exit_code == 0
|
|
193
|
+
assert "offset=-5" in r.stdout
|
|
194
|
+
|
|
195
|
+
# Short flag form
|
|
196
|
+
r = app.test(["cmd", "-o", "-5"])
|
|
197
|
+
assert r.exit_code == 0
|
|
198
|
+
assert "offset=-5" in r.stdout
|
strictcli-0.1.0/.rlsbl/version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.21.2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|