negative/
negative.rs

1//! Parsing negative numbers from the command line. `bpaf` won't try to do anything special here,
2//! user will have to escape minus sign either with `=` or --
3use bpaf::*;
4
5fn main() {
6    let age = long("age").argument::<i64>("AGE");
7    let msg = "\
8To pass a value that starts with a dash requres one one of two special syntaxes:
9
10This will pass '-1' to '--age' handler and leave remaining arguments as is
11    --age=-1
12This will transform everything after '--' into non flags, '--age' will handle '-1'
13and positional handlers will be able to handle the rest.
14    --age -- -1";
15    let num = age.to_options().descr(msg).run();
16    println!("age: {}", num);
17}