Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: auto alias subcmds with hyphens for underscores #336

Merged
merged 1 commit into from
Jun 8, 2024
Merged

Conversation

sigoden
Copy link
Owner

@sigoden sigoden commented Jun 8, 2024

If the subcommand name contains _, argc will automaticly generate a alias (_ => -) for it.

#!/bin/bash
set -e

# @cmd
foo_bar() {
    echo OK
}

eval "$(argc --argc-eval "$0" "$@")"
$ prog -h
USAGE: prog<COMMAND>

COMMANDS:
  foo_bar  [aliases: foo-bar]

$ prog foo_bar
OK

$ grog foo-bar
OK

@sigoden sigoden changed the title feat: auto alias if subcommand name contains _ feat: auto alias subcmds with hyphens for underscores Jun 8, 2024
@sigoden sigoden merged commit 2892e55 into main Jun 8, 2024
4 checks passed
@sigoden sigoden deleted the feat branch June 8, 2024 21:55
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