Skip to content

Commit 11d6b20

Browse files
committed
cli: Ensure help is actually displayed
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
1 parent f6f9dc9 commit 11d6b20

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/cli/rustup_mode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ pub fn main() -> Result<utils::ExitCode> {
6161
if e.kind == clap::ErrorKind::HelpDisplayed
6262
|| e.kind == clap::ErrorKind::VersionDisplayed =>
6363
{
64-
return Ok(utils::ExitCode(0))
64+
writeln!(process().stdout().lock(), "{}", e.message)?;
65+
return Ok(utils::ExitCode(0));
6566
}
6667
Err(e) => Err(e),
6768
}?;

src/cli/setup_mode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ pub fn main() -> Result<utils::ExitCode> {
9898
if e.kind == clap::ErrorKind::HelpDisplayed
9999
|| e.kind == clap::ErrorKind::VersionDisplayed =>
100100
{
101-
return Ok(utils::ExitCode(0))
101+
writeln!(process().stdout().lock(), "{}", e.message)?;
102+
return Ok(utils::ExitCode(0));
102103
}
103104
Err(e) => Err(e)?,
104105
};

0 commit comments

Comments
 (0)