Skip to content

Conversation

@ianloic
Copy link

@ianloic ianloic commented Dec 23, 2025

This commit introduces the synonyms attribute to #[argh()], allowing users to specify alternative names for subcommands, options, and switches. Synonyms are hidden from the help output but are accepted during parsing.

Key changes:

  • Added synonyms = ["..."] attribute support in argh_derive.
  • Extended SubCommand trait with SYNONYMS constant.
  • Extended SubCommands trait with COMMAND_SYNONYMS constant.
  • Updated ParseStructSubCommand::parse to check synonyms.
  • Updated documentation with examples.

This implementation avoids breaking changes to the public CommandInfo API by storing synonym information in the SubCommand trait instead.

This commit introduces the `synonyms` attribute to `#[argh()]`, allowing
users to specify alternative names for subcommands, options, and
switches.  Synonyms are hidden from the help output but are accepted
during parsing.

Key changes:
- Added `synonyms = ["..."]` attribute support in argh_derive.
- Extended `SubCommand` trait with `SYNONYMS` constant.
- Extended `SubCommands` trait with `COMMAND_SYNONYMS` constant.
- Updated `ParseStructSubCommand::parse` to check synonyms.
- Updated documentation with examples.

This implementation avoids breaking changes to the public `CommandInfo`
API by storing synonym information in the `SubCommand` trait instead.
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