Skip to content

fix(cli): fix cargo subcommand parsing and update README#6

Merged
rocketman-code merged 1 commit intomainfrom
fix/cargo-subcommand-parsing
Feb 23, 2026
Merged

fix(cli): fix cargo subcommand parsing and update README#6
rocketman-code merged 1 commit intomainfrom
fix/cargo-subcommand-parsing

Conversation

@rocketman-code
Copy link
Copy Markdown
Owner

Summary

  • Simplify cargo subcommand detection: always strip argv[1] when it's "avail", matching the standard pattern used by cargo-edit, cargo-nextest, etc. The previous approach inspected argv[0] basename, which was unnecessarily complex.
  • Remove allow_hyphen_values from clap — hyphen-starting names can be passed after -- instead, which is the standard CLI convention.
  • Add tests for subcommand stripping, flags after positional args, and -- separator.
  • Update README: add crates.io badge, fix stdin example portability, use short flags, remove unreachable match arm from library example.

Test plan

  • cargo test passes (all existing + new CLI tests)
  • Manual: cargo avail std shows "reserved"
  • Manual: cargo avail --json std outputs valid NDJSON
  • Manual: cargo avail -- ---test reports invalid name

@rocketman-code rocketman-code force-pushed the fix/cargo-subcommand-parsing branch from e879b76 to 5f7111a Compare February 23, 2026 04:04
@rocketman-code rocketman-code merged commit 5014d4f into main Feb 23, 2026
6 of 7 checks passed
@rocketman-code rocketman-code deleted the fix/cargo-subcommand-parsing branch February 23, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant