Merge pull request #3232 from epage/version

fix(help): Prefer short version over long version
This commit is contained in:
Ed Page 2021-12-30 12:41:18 -06:00 committed by GitHub
commit e20c034b23

View file

@ -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))?;
} }