StructConf is a derive macro that allows you to combine argument parsing from clap and config file parsing from rust-ini at compile time. It's inspired by the argument parser gumdrop, and developed to be used in Vidify. Example:
use structconf::StructConf;
#[derive(StructConf)]
struct Config {
#[conf(help = "description for the argument parser.")]
pub default: i32,
#[conf(no_file)]
pub args_opt: u8,
#[conf(no_short, no_long)]
pub conf_opt: Option<String>,
#[conf(no_short, no_long, no_file)]
pub ignored: bool,
#[conf(short = "x", long = "renamed-opt", file = "my_opt",
help = "custom names.")]
pub renamed: String,
#[conf(short = "n", long = "no_pancakes", help = "disable pancakes.")]
pub pancakes: bool,
#[conf(default = "123.45")]
pub floating: f64,
}
Read the docs for more details on how to use StructConf.