Repository navigation
🐛 fix(cli): reject unknown flags on the ui subcommand - #318
Conversation
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
Overlap note: #319 (by @mendezr) also fixes #317 and touches the same files (src/cli.ts, src/cli.test.ts, dist/cli*.js*). Whichever lands first will leave the other conflicting; the second one should be rebased or closed as superseded rather than both merging. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #317
Summary
The
uisubcommand silently accepted any--flagwithout validation. Only--portwas read; everything else was dropped on the floor. A typo'd port flag (e.g.,--prot=3700) would start the server on the default port with no error.Changes
assertOnlyFlags(flags, allowed, command)that validates flag keys against an allowlist and throws aUsageErrorwith clear messaging.uicommand now callsassertOnlyFlags(flags, ['port'], 'ui')before dispatching tostartUI.assertOnlyFlagshelper--prot,--json,--cross,--status,--no-interactive) to verify they are rejected with the expected error messageError Message
Unknown flag --prot: ui only accepts --port=<value>Follows the house style established in #314 for unknown-flag rejection.
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88