fix(cli): handle --help/--version, error on unknown args (#21) #22
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_browser!22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/21-help-version-flags"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The
hero_browser_serverbinary did no argument parsing — any flag, including--helpand--version, fell through and started the daemon. Any tool probing the binary with--help(CLI introspection, completion generators, packaging tools) would accidentally launch a server.Fixes #21.
Changes
Small hand-rolled arg matcher in
main():-h/--help→ print usage, exit 0-V/--version→ printhero_browser_server <CARGO_PKG_VERSION>, exit 0--help, exit 2No new deps. The binary is intentionally minimal per its module-level doc comment, so
clapderive felt heavy for two flags.Test plan
Verified manually on Linux x86_64 with the rebuilt release binary:
MCP
tools/listround-trip verified against the running daemon after install. No regressions to the bare-invocation path.