We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From #824
extern crate clap; use clap::{Arg, App}; fn main() { let m = App::new("Test app") .version("1.0") .author("F0x06") .about("Arg test") .arg(Arg::with_name("target") .takes_value(true) .default_value("file") .possible_values(&["file", "stdout"]) .long("target")) .arg(Arg::with_name("input") .takes_value(true) .required(true) .long("input")) .arg(Arg::with_name("output") .takes_value(true) .required_if("target", "file") .long("output")) .get_matches_from_safe(vec!["test", "--input", "some"]); assert!(m.is_err()); assert_eq!(m.unwrap_err().kind, ErrorKind::MissingRequiredArgument); }
The text was updated successfully, but these errors were encountered:
fix: fixes a bug where default values should have triggered a conditi…
469d270
…onal requirement but didnt Closes #831
996d5e1
a7a44ba
92919f5
No branches or pull requests
From #824
The text was updated successfully, but these errors were encountered: