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.
Files changed (40) hide show
  1. {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/hashes.json +1 -1
  2. strictcli-0.1.1/.rlsbl/version +1 -0
  3. {strictcli-0.1.0 → strictcli-0.1.1}/CHANGELOG.md +4 -0
  4. {strictcli-0.1.0 → strictcli-0.1.1}/PKG-INFO +1 -1
  5. {strictcli-0.1.0 → strictcli-0.1.1}/package-lock.json +2 -2
  6. {strictcli-0.1.0 → strictcli-0.1.1}/package.json +1 -1
  7. {strictcli-0.1.0 → strictcli-0.1.1}/pyproject.toml +1 -1
  8. {strictcli-0.1.0 → strictcli-0.1.1}/strictcli/__init__.py +2 -2
  9. {strictcli-0.1.0 → strictcli-0.1.1}/tests/test_parser.py +20 -0
  10. strictcli-0.1.0/.rlsbl/version +0 -1
  11. {strictcli-0.1.0 → strictcli-0.1.1}/.claude/settings.json +0 -0
  12. {strictcli-0.1.0 → strictcli-0.1.1}/.github/workflows/ci.yml +0 -0
  13. {strictcli-0.1.0 → strictcli-0.1.1}/.github/workflows/publish.yml +0 -0
  14. {strictcli-0.1.0 → strictcli-0.1.1}/.gitignore +0 -0
  15. {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/.claude/settings.json +0 -0
  16. {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/.github/workflows/ci.yml +0 -0
  17. {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/.github/workflows/publish.yml +0 -0
  18. {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/.gitignore +0 -0
  19. {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/.rlsbl/hooks/post-release.sh +0 -0
  20. {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/.rlsbl/hooks/pre-release.sh +0 -0
  21. {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/CHANGELOG.md +0 -0
  22. {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/CLAUDE.md +0 -0
  23. {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/bases/LICENSE +0 -0
  24. {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/config.json +0 -0
  25. {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/hooks/post-release.sh +0 -0
  26. {strictcli-0.1.0 → strictcli-0.1.1}/.rlsbl/hooks/pre-release.sh +0 -0
  27. {strictcli-0.1.0 → strictcli-0.1.1}/CLAUDE.md +0 -0
  28. {strictcli-0.1.0 → strictcli-0.1.1}/LICENSE +0 -0
  29. {strictcli-0.1.0 → strictcli-0.1.1}/README.md +0 -0
  30. {strictcli-0.1.0 → strictcli-0.1.1}/index.js +0 -0
  31. {strictcli-0.1.0 → strictcli-0.1.1}/postinstall.js +0 -0
  32. {strictcli-0.1.0 → strictcli-0.1.1}/tests/test_e2e.py +0 -0
  33. {strictcli-0.1.0 → strictcli-0.1.1}/tests/test_env.py +0 -0
  34. {strictcli-0.1.0 → strictcli-0.1.1}/tests/test_help.py +0 -0
  35. {strictcli-0.1.0 → strictcli-0.1.1}/tests/test_nesting.py +0 -0
  36. {strictcli-0.1.0 → strictcli-0.1.1}/tests/test_registration.py +0 -0
  37. {strictcli-0.1.0 → strictcli-0.1.1}/tests/test_tags.py +0 -0
  38. {strictcli-0.1.0 → strictcli-0.1.1}/todo/.done/original-idea.md +0 -0
  39. {strictcli-0.1.0 → strictcli-0.1.1}/todo/deferred.md +0 -0
  40. {strictcli-0.1.0 → strictcli-0.1.1}/uv.lock +0 -0
@@ -1,5 +1,5 @@
1
1
  {
2
- ".github/workflows/ci.yml": "d71e558f1bfd93b43a783054577698da34c3e45455c6039686e06a7449b2bf1b",
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
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.1
4
+
5
+ - Fix: str flag values starting with hyphen (e.g. `--offset -5`) no longer rejected
6
+
3
7
  ## 0.1.0
4
8
 
5
9
  - Decorator-based command registration with `@app.command` and `@strictcli.flag`/`@strictcli.arg`
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: strictcli
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: A strict, zero-dependency CLI framework for Python
5
5
  Project-URL: Homepage, https://github.com/smm-h/strictcli
6
6
  Project-URL: Repository, https://github.com/smm-h/strictcli
@@ -1,11 +1,11 @@
1
1
  {
2
- "name": "excli",
2
+ "name": "strictcli",
3
3
  "version": "0.1.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
- "name": "excli",
8
+ "name": "strictcli",
9
9
  "version": "0.1.0",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strictcli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "A strict, zero-dependency CLI framework for Python (npm wrapper)",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "strictcli"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  description = "A strict, zero-dependency CLI framework for Python"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -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) and not tokens[i + 1].startswith("-"):
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) and not tokens[i + 1].startswith("-"):
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
@@ -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