We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bde7f78 + 3cd75c8 commit 640bedcCopy full SHA for 640bedc
src/cli/rustup_mode.rs
@@ -94,15 +94,22 @@ pub fn main() -> Result<utils::ExitCode> {
94
}
95
return Ok(utils::ExitCode(0));
96
97
- Err(clap::Error {
98
- kind: MissingArgumentOrSubcommand,
99
- message,
100
- ..
101
- }) => {
102
- writeln!(process().stdout().lock(), "{}", message)?;
103
- return Ok(utils::ExitCode(1));
104
- }
105
- Err(e) => Err(e),
+
+ Err(e) => match &e {
+ clap::Error { kind, message, .. } => {
+ if [
+ InvalidSubcommand,
+ UnknownArgument,
+ MissingArgumentOrSubcommand,
+ ]
+ .contains(kind)
106
+ {
107
+ writeln!(process().stdout().lock(), "{}", message)?;
108
+ return Ok(utils::ExitCode(1));
109
+ }
110
+ Err(e)
111
112
+ },
113
}?;
114
let verbose = matches.is_present("verbose");
115
let quiet = matches.is_present("quiet");
0 commit comments