# clappconfig - CLI app config boilerplate ```none Clap App Config ----------- clappconfig ``` This crate provides a simple CLI app boilerplate that takes care of the most repetitive init tasks: - Load JSON5 config from a custom or default path (or use `Default::default()`) - Set up logging, with CLI and config-based overrides - Optionally print the loaded or default config - Show help / version on demand, courtesy of `clap` - Optional start-up banner print Supports custom `clap` arguments as well. -> The repository is open to improvement PRs. ## Logging - uses `env_logger` by default - level can be set in the config file - log level can be overridden by the `--log` CLI flag - log level can be increased by repeated use of `-v` or `--verbose` ## Example See the examples directory. The example called "rotn" implements rot13 as a command-line tool. ```none $ cargo run --example complete -- -h Rot-N 0.1.0 by Ondřej Hruška USAGE: rotn [FLAGS] [OPTIONS] --input FLAGS: --default-config Print the default config JSON for reference (or to be piped to a file) --dump-config Print the loaded config struct -h, --help Prints help information -V, --version Prints version information -v, --verbose Increase logging verbosity (repeat to increase) OPTIONS: -c, --config Sets a custom config file (JSON5) -i, --input Input file --log Set logging verbosity (error,warning,info,debug,trace) -n, --shift Positive or negative shift, default 13 ``` To get rot13 of this README, run `cargo run --example rotn -- -iREADME.md`.