mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
7e899cd340
This reverts commits 24cb8b1..d0abb37 from clap-rs/clap#1840 This is part of #16. clap-rs/clap#1840 wasn't the right call but we don't have time to make the decision now, so instead of having one option and changing it in 4.0, this reverts back to clap2 behavior.
17 lines
488 B
Rust
17 lines
488 B
Rust
use clap::{App, Arg};
|
|
|
|
#[test]
|
|
fn borrowed_args() {
|
|
let arg = Arg::new("some").short('s').long("some").help("other help");
|
|
let arg2 = Arg::new("some2")
|
|
.short('S')
|
|
.long("some-thing")
|
|
.help("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());
|
|
}
|