Important
Figue has moved into the Facet monorepo.
New source: https://github.com/facet-rs/facet/tree/main/figue
New docs entry point: https://facet.rs/ecosystem/figue/
This repository is kept only as a historical pointer and will be archived.
figue (pronounced 'fig', like the fruit) provides configuration parsing from CLI arguments, environment variables, and config files, a bit like figment but based on facet reflection:
use facet_pretty::FacetPretty;
use facet::Facet;
use figue as args;
#[derive(Facet)]
struct Args {
#[facet(args::positional)]
path: String,
#[facet(args::named, args::short = 'v')]
verbose: bool,
#[facet(args::named, args::short = 'j')]
concurrency: usize,
}
# fn main() -> Result<(), Box<dyn std::error::Error>> {
let args: Args = figue::from_slice(&["--verbose", "-j", "14", "example.rs"])?;
eprintln!("args: {}", args.pretty());
Ok(())
# }The entry point of figue is [builder] — let yourself be guided from there.
- Guide & reference: https://figue.bearcove.eu — task-oriented guide, copy-paste recipes, and an exhaustive reference (attributes, grammar, merge rules, error catalog).
- API docs: https://docs.rs/figue
The site sources live in docs/ and are built with
dodeca (ddc serve locally, deployed to
GitHub Pages on push to main).
figue uses facet-color for coloring output.
Run hooks/install.sh to install pre-commit and pre-push hooks.
Thanks to all individual sponsors:
...along with corporate sponsors:
...without whom this work could not exist.
The facet logo was drawn by Misiasart.
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.