positional_derive/positional_derive.rs
1//! Derive for struct with named values that uses positional argument
2
3use bpaf::*;
4use std::path::PathBuf;
5
6#[allow(dead_code)]
7#[derive(Debug, Clone, Bpaf)]
8#[bpaf(options)]
9struct Options {
10 /// Mysterious value
11 #[bpaf(argument("VAL"), fallback(42))]
12 value: u32,
13 #[bpaf(positional("FILE"))]
14 files: Vec<PathBuf>,
15}
16
17fn main() {
18 let opts = options().run();
19 println!("{:#?}", opts);
20}