Skip to content

Commit 19b183a

Browse files
committed
Improve error message for unsupported subcommand
1 parent 0ef3724 commit 19b183a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@ pub fn main() -> Result<()> {
3030
help::print_help();
3131
return Ok(())
3232
}
33-
other => return Err(anyhow!(
34-
"Unsupported subcommand `{:?}`. See `bootimage --help` for an overview of supported programs.", other
35-
))
33+
Some(other) => return Err(anyhow!(
34+
"Unsupported subcommand `{:?}`. See `bootimage --help` for an overview of supported subcommands.", other
35+
)),
36+
None => return Err(anyhow!(
37+
"Please invoke bootimage with a subcommand. See `bootimage --help` for more information."
38+
)),
3639
}
3740

3841
let exit_code = match RunnerCommand::parse_args(raw_args)? {

0 commit comments

Comments
 (0)