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: support default subcommand #296

Merged
merged 1 commit into from Feb 5, 2024
Merged

feat: support default subcommand #296

merged 1 commit into from Feb 5, 2024

Conversation

sigoden
Copy link
Owner

@sigoden sigoden commented Feb 5, 2024

use @meta default-subcommand to set the current subcommand as the default.

# describe Sample CLI that uses the default command option

# @cmd Upload a file
# @meta default-subcommand
upload() {
    echo upload "$@"
}

# @cmd Download a file
download() {
    echo download "$@"
}

eval "$(argc --argc-eval "$0" "$@")"
$ bash examples/command-default.sh foo
upload foo
$ bash examples/command-default.sh upload foo
upload foo

@sigoden sigoden merged commit 8109e1e into main Feb 5, 2024
3 checks passed
@sigoden sigoden deleted the feat-default-subcommand branch February 5, 2024 09:18
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.

None yet

1 participant