Argc
Make beautiful bash cli with comments, also is a cross-platform bash command runner.
Usage
Make beautiful cli with comments

To write a command-line program with Argc, we only need to do two things:
- Describe the options, parameters, and subcommands in comments
- Call the following command to entrust Argc to process command line parameters for us
Argc will do the following for us:
- Extract parameter definitions from comments
- Parse command line arguments
- If the parameter is abnormal, output error text or help information
- If everything is normal, output the parsed parameter variable
- If there is a subcommand, call the subcommand function
We can easily access the corresponding option or parameter through the variable $argc_<name>.
Try examples/demo.sh your self.
The @cmd, @arg, @option is comment tag(fields marked with @ in comments), argc generates parsing rules and help documentation based on comment tags .
See docs/comment-tag.md for more details.
command runner
argc will enter the command runner mode if you do not activate its other modes with the --argc-* option.
What argc does in command runner mode is: locate bash, search for argcfile in the current project and its parent directory, then run argcfile with bash.
argcfileis a plain shell script, you can run it throughbash argcfile.
Argc is written in rust, It is cross-platform. It is a single executable file less than 1M without any dependencies. you just download it and put it into $PATH directory to install it.
Bash is already builtin in macos/linux. On Windows, most developers already have git installed, argc uses the bash that ships with git.
So argc/argcfile is a cross-platform command runner solution.
Use the bash you are most familiar with, no need to learn another language or set of syntax.
You can also freely use GNU tools like ls, rm, grep, find, sed, awk, etc. Don't worry about windows incompatibility.

See docs/command-runner.md for more details
Generate completion script
argc --argc-completion demo.sh
Install
With cargo
cargo install argc
Binaries on macOS, Linux, Windows
Download from Github Releases, unzip and add argc to your $PATH.
GitHub Actions
extractions/setup-crate can be used to install just in a GitHub Actions workflow.
- uses: extractions/setup-crate@v1
with:
owner: sigoden
name: argc
CLI
Bash cli utility - https://github.com/sigoden/argc
USAGE:
argc [OPTIONS] [ARGS]
ARGS:
<SCRIPT> Specific script file
<ARGUMENTS>... Arguments passed to script file
OPTIONS:
--argc-completion Print bash completion script
--argc-eval Print code snippets for eval
--argc-help Print help information
--argc-version Print version information
License
Copyright (c) 2022 argc-developers.
argc is made available under the terms of either the MIT License or the Apache License 2.0, at your option.
See the LICENSE-APACHE and LICENSE-MIT files for license details.