fix: reject CLI declarations shadowed by built-in routes - #514
Conversation
|
Two findings from review, both actionable: 1. 2. |
|
Addressed in commit 1f59a38: the exact '-' segment is accepted again, and one canonical built-in-option classifier now drives both declaration-time reservation checks and runtime help/version interception. |
|
Follow-up: hosted pinned-shfmt validation caught one formatting difference not reported by the locally installed formatter. Corrected in aff9a25; the CLI BATS suite still passes (38 tests), and the refreshed hosted checks are queued. |
|
Confirmed fixed. |
Summary
Reserve built-in help/version options, reject option-shaped command and alias routes, and validate that no stored model route is intercepted by built-in parsing. The direct API and table declarations remain atomic on rejection.
Issue
Fixes #506
Validation
bats lib/bash/cli/tests/lib_cli.bats— passed (37 tests).git diff --check— passed.Demo Impact
None.
Docs Impact
None; the CLI route boundary is enforced at declaration and validation time.
API Impact
Invalid declarations that were previously accepted now return usage status 2 before model mutation.
CI Impact
Adds direct, nested, table-driven, and model-integrity coverage.
Security Notes
None.