mirror of
https://github.com/clap-rs/clap
synced 2024-11-14 00:27:13 +00:00
17 lines
490 B
Rust
17 lines
490 B
Rust
use clap::{App, Arg};
|
|
|
|
#[test]
|
|
fn borrowed_args() {
|
|
let arg = Arg::new("some").short('s').long("some").about("other help");
|
|
let arg2 = Arg::new("some2")
|
|
.short('S')
|
|
.long("some-thing")
|
|
.about("other help");
|
|
let result = App::new("sub_command_negate")
|
|
.arg(Arg::new("test").index(1))
|
|
.arg(&arg)
|
|
.arg(&arg2)
|
|
.subcommand(App::new("sub1").arg(&arg))
|
|
.try_get_matches_from(vec!["prog"]);
|
|
assert!(result.is_ok());
|
|
}
|