mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
Merge pull request #3232 from epage/version
fix(help): Prefer short version over long version
This commit is contained in:
commit
e20c034b23
1 changed files with 1 additions and 5 deletions
|
@ -634,11 +634,7 @@ impl<'help, 'app, 'parser, 'writer> Help<'help, 'app, 'parser, 'writer> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_version(&mut self) -> io::Result<()> {
|
fn write_version(&mut self) -> io::Result<()> {
|
||||||
let version = if self.use_long {
|
let version = self.parser.app.version.or(self.parser.app.long_version);
|
||||||
self.parser.app.long_version.or(self.parser.app.version)
|
|
||||||
} else {
|
|
||||||
self.parser.app.version
|
|
||||||
};
|
|
||||||
if let Some(output) = version {
|
if let Some(output) = version {
|
||||||
self.none(text_wrapper(output, self.term_w))?;
|
self.none(text_wrapper(output, self.term_w))?;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue