pub fn opt<T>(
short: &str,
long: &str,
doc: &str,
hint: &str,
) -> impl Arg<Item = Option<T>>Examples found in repository?
examples/area.rs (line 6)
5fn main() {
6 match opt::<f32>("", "width", "", "")
7 .depend(opt::<f32>("", "height", "", ""))
8 .option_map(|(x, y)| (x, y))
9 .option_map(|(x, y)| x * y)
10 .required()
11 .parse_env()
12 .result
13 {
14 Ok(area) => println!("area: {:?}", area),
15 Err(e) => panic!("{}", e),
16 }
17}