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: works as command runner #23

Merged
merged 3 commits into from
Jul 27, 2022
Merged

feat: works as command runner #23

merged 3 commits into from
Jul 27, 2022

Conversation

sigoden
Copy link
Owner

@sigoden sigoden commented Jul 26, 2022

argc will works as command runner.

You create build script named argcfile

#!/bin/bash 
set -eo pipefail

# @cmd Test all crates and modules
# @alias t,test
tst() {
    cargo test --all
}

# @cmd Format/clippy code
fmt() {
    cargo clippy --all --all-targets
    cargo fmt --all
}

eval "$(argc --argc-eval $0 "$@")"

run argc equals to bash argcfile, argc will search for argcfile then execute it. like make/makefile.

argcfile 

USAGE:
    argcfile <SUBCOMMAND>

OPTIONS:
    -h, --help    Print help information

SUBCOMMANDS:
    fmt     Format/clippy code
    help    Print this message or the help of the given subcommand(s)
    tst     Test all crates and modules [aliases: t, test]

@sigoden sigoden merged commit 838a50d into main Jul 27, 2022
@sigoden sigoden deleted the command-runner branch July 27, 2022 01:46
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