mirror of
https://github.com/clap-rs/clap
synced 2024-11-14 16:47:21 +00:00
15 lines
No EOL
439 B
Rust
15 lines
No EOL
439 B
Rust
extern crate clap;
|
|
|
|
use clap::{App, Arg, SubCommand, AppSettings};
|
|
|
|
#[test]
|
|
fn sub_command_negate_requred() {
|
|
App::new("sub_command_negate")
|
|
.setting(AppSettings::SubcommandsNegateReqs)
|
|
.arg(Arg::with_name("test")
|
|
.required(true)
|
|
.index(1))
|
|
.subcommand(SubCommand::with_name("sub1"))
|
|
.subcommand(SubCommand::with_name("sub1"))
|
|
.get_matches_from(vec!["", "sub1"]);
|
|
} |