structopt-toml
An default value loader from TOML for structopt. It combinates with structopt.
Usage
This crate must be used with serde, serde_derive, structopt, and toml explicitly.
[]
= "1.0.33"
= "1.0.33"
= "0.2.5"
= "0.2.4"
= "0.4.5"
Example
If derive(Deserialize), derive(StructOptToml) and serde(default) are added to the struct with derive(StructOpt), some functions like from_args_with_toml can be used.
extern crate serde_derive;
extern crate structopt;
extern crate structopt_toml;
extern crate toml;
use StructOpt;
use StructOptToml;
The execution result is below.
$ ./example
a:10 // value from TOML string
b:0 // value from default_value of structopt
$ ./example -a 20
a:20 // value from command line argument
b:0