mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 23:04:23 +00:00
v0.3.3.2
This commit is contained in:
parent
c1836f8d1d
commit
a58b5d34b2
1 changed files with 6 additions and 5 deletions
11
src/app.rs
11
src/app.rs
|
@ -180,9 +180,10 @@ impl App {
|
|||
println!("");
|
||||
println!("OPTIONS:");
|
||||
for (_, v) in self.opts.iter() {
|
||||
println!("{}{}\t\t{}",
|
||||
println!("{}{}{}\t\t{}",
|
||||
if let Some(ref s) = v.short{format!("-{}",s)}else{format!(" ")},
|
||||
if let Some(ref l) = v.long {format!(",--{}",l)}else {format!(" ")},
|
||||
format!(" <{}>", v.name),
|
||||
if let Some(ref h) = v.help {*h} else {" "} );
|
||||
}
|
||||
}
|
||||
|
@ -404,26 +405,26 @@ impl App {
|
|||
for name in self.blacklist.iter() {
|
||||
for (k, v) in matches.flags.iter() {
|
||||
if k == name {
|
||||
self.report_error(&format!("The argument \"{}\" is mutually exclusive with one or more other arguments",
|
||||
self.report_error(&format!("The argument {} is mutually exclusive with one or more other arguments",
|
||||
if let Some(s) = v.short {
|
||||
format!("-{}", s)
|
||||
} else if let Some(l) = v.long {
|
||||
format!("--{}", l)
|
||||
} else {
|
||||
format!("{}", v.name)
|
||||
format!("\"{}\"", v.name)
|
||||
}),
|
||||
false, true);
|
||||
}
|
||||
}
|
||||
for (k, v) in matches.opts.iter() {
|
||||
if k == name {
|
||||
self.report_error(&format!("The argument \"{}\" is mutually exclusive with one or more other arguments",
|
||||
self.report_error(&format!("The argument {} is mutually exclusive with one or more other arguments",
|
||||
if let Some(s) = v.short {
|
||||
format!("-{}", s)
|
||||
} else if let Some(l) = v.long {
|
||||
format!("--{}", l)
|
||||
} else {
|
||||
format!("{}", v.name)
|
||||
format!("\"{}\"", v.name)
|
||||
}),
|
||||
false, true);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue