mirror of
https://github.com/clap-rs/clap
synced 2025-01-05 17:28:42 +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!("");
|
||||||
println!("OPTIONS:");
|
println!("OPTIONS:");
|
||||||
for (_, v) in self.opts.iter() {
|
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 s) = v.short{format!("-{}",s)}else{format!(" ")},
|
||||||
if let Some(ref l) = v.long {format!(",--{}",l)}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 {" "} );
|
if let Some(ref h) = v.help {*h} else {" "} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -404,26 +405,26 @@ impl App {
|
||||||
for name in self.blacklist.iter() {
|
for name in self.blacklist.iter() {
|
||||||
for (k, v) in matches.flags.iter() {
|
for (k, v) in matches.flags.iter() {
|
||||||
if k == name {
|
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 {
|
if let Some(s) = v.short {
|
||||||
format!("-{}", s)
|
format!("-{}", s)
|
||||||
} else if let Some(l) = v.long {
|
} else if let Some(l) = v.long {
|
||||||
format!("--{}", l)
|
format!("--{}", l)
|
||||||
} else {
|
} else {
|
||||||
format!("{}", v.name)
|
format!("\"{}\"", v.name)
|
||||||
}),
|
}),
|
||||||
false, true);
|
false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (k, v) in matches.opts.iter() {
|
for (k, v) in matches.opts.iter() {
|
||||||
if k == name {
|
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 {
|
if let Some(s) = v.short {
|
||||||
format!("-{}", s)
|
format!("-{}", s)
|
||||||
} else if let Some(l) = v.long {
|
} else if let Some(l) = v.long {
|
||||||
format!("--{}", l)
|
format!("--{}", l)
|
||||||
} else {
|
} else {
|
||||||
format!("{}", v.name)
|
format!("\"{}\"", v.name)
|
||||||
}),
|
}),
|
||||||
false, true);
|
false, true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue