Crates.io | confargs |
lib.rs | confargs |
version | 0.1.3 |
source | src |
created_at | 2022-08-30 12:31:33.922109 |
updated_at | 2022-08-31 08:21:11.558001 |
description | Parse configuration files into a set arguments |
homepage | |
repository | https://github.com/rvolosatovs/confargs |
max_upload_size | |
id | 655128 |
size | 30,483 |
confargs
is a Rust library, which parses a configuration file in arbitrary format into a iterator of command-line arguments. The main use case for this is to add configuration file support for CLI tools and argument parsers, which do not have support for configuration files.
This project primarily aims at compatibility with clap, which is tested automatically in CI. Other libraries should work as well, but that is not tested.
Examples are provided in examples
directory along an example configuration files in supported formats.
From the root of the repository:
$ cargo run -q --example clap
Args { string: "string", integer: 42, float: 42.2, array: [] }
$ cargo run -q --example clap -- @examples/conf.toml
Args { string: "conf", integer: -42, float: -42.2, array: ["test", "config"] }