https://github.com/abitofhelp/rust_clap_figment
This project demonstrates how to use Clap and Figment to implement hierarchical configuration in a Rust CLI application.
https://github.com/abitofhelp/rust_clap_figment
clap clap-rs figment hierarchical-configuration rust
Last synced: 2 months ago
JSON representation
This project demonstrates how to use Clap and Figment to implement hierarchical configuration in a Rust CLI application.
- Host: GitHub
- URL: https://github.com/abitofhelp/rust_clap_figment
- Owner: abitofhelp
- License: mit
- Created: 2024-04-04T23:20:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-04T23:22:41.000Z (about 1 year ago)
- Last Synced: 2024-04-24T03:21:28.080Z (about 1 year ago)
- Topics: clap, clap-rs, figment, hierarchical-configuration, rust
- Language: Rust
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rust_clap_figment
## About
This project demonstrates how to use Clap and Figment to implement hierarchical configuration in a Rust CLI application.
By default, Figment prioritizes its configuration sources opposite to our use, 'defaults < file < envvar < cli',
so some workarounds were required. Jesse Steezeburger (see: https://steezeburger.com/2023/03/rust-hierarchical-configuration)
presented a set of workarounds, which were used in this application.This application uses humantime::Duration for expressing duration values, such as "10s" and "1000ms",
which provides self-documenting duration information.