-
Considering this modified command chaining example: use bpaf::{positional, Bpaf, Parser};
#[derive(Debug, Clone, Bpaf)]
#[bpaf(options)]
pub struct Options {
#[bpaf(external(cmd), many)]
pub commands: Vec<Cmd>,
}
#[derive(Debug, Clone, Bpaf)]
pub enum Cmd {
#[bpaf(command, adjacent)]
/// Performs drinking action
Drink {
#[bpaf(positional("BEVERAGE"))]
coffee: isize, // <------------- KEY CHANGE HERE
},
#[bpaf(command, adjacent)]
/// Performs taking a nap action
Sleep,
}
fn main() {
println!("{:?}", options().run())
} I can't find a way to allow passing negative values to the
Is there another way to support positional negative values? |
Beta Was this translation helpful? Give feedback.
Answered by
pacak
Apr 1, 2024
Replies: 1 comment 7 replies
-
|
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
abey79
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#347