mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
fix: fixes a bug where positional argument help text is misaligned
This commit is contained in:
parent
c556b39fd0
commit
54c16836de
2 changed files with 5 additions and 5 deletions
|
@ -104,7 +104,7 @@ impl<'n, 'e> Display for PosBuilder<'n, 'e> {
|
|||
} else {
|
||||
try!(write!(f, "<{}>", self.b.name));
|
||||
}
|
||||
if self.b.settings.is_set(ArgSettings::Multiple) && self.v.val_names.is_none() {
|
||||
if self.b.settings.is_set(ArgSettings::Multiple) && (self.v.val_names.is_none() || self.v.val_names.as_ref().unwrap().len() == 1) {
|
||||
try!(write!(f, "..."));
|
||||
}
|
||||
|
||||
|
|
|
@ -398,8 +398,8 @@ OPTIONS:
|
|||
-t, --timeout <SECONDS> Timeout in seconds. By default, there is no timeout.
|
||||
|
||||
ARGS:
|
||||
<BINFILE> The path of the binary to be profiled. If empty, Cargo.toml is searched for a binary.
|
||||
<ARGS>... Any arguments you wish to pass to the binary being profiled.";
|
||||
<BINFILE> The path of the binary to be profiled. for a binary.
|
||||
<ARGS>... Any arguments you wish to pass to the being profiled.";
|
||||
|
||||
static LAST_ARG_REQ_MULT: &'static str = "example 1.0
|
||||
|
||||
|
@ -501,12 +501,12 @@ fn args_with_last_usage() {
|
|||
.takes_value(true)
|
||||
)
|
||||
.arg(Arg::with_name("binary path")
|
||||
.help("The path of the binary to be profiled. If empty, Cargo.toml is searched for a binary.")
|
||||
.help("The path of the binary to be profiled. for a binary.")
|
||||
.takes_value(true)
|
||||
.value_name("BINFILE")
|
||||
)
|
||||
.arg(Arg::with_name("pass through args")
|
||||
.help("Any arguments you wish to pass to the binary being profiled.")
|
||||
.help("Any arguments you wish to pass to the being profiled.")
|
||||
.value_name("ARGS")
|
||||
.last(true)
|
||||
.multiple(true)
|
||||
|
|
Loading…
Reference in a new issue