summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-03-11 08:28:04 +0100
committerMatthias Beyer <matthias.beyer@atos.net>2021-03-11 08:28:04 +0100
commit6a188e26815579a6de5ce4eee8271d3801e80f63 (patch)
tree64912bc956591bf8d23ae867611a973bbdc69572
parent04205d2b5201af21186cc257b4019752b1d1173d (diff)
Add more verbose error output if no subcommand is given
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
-rw-r--r--src/main.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index b93df83..dc00524 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -55,6 +55,7 @@ use anyhow::Context;
use anyhow::Result;
use clap::ArgMatches;
use logcrate::debug;
+use logcrate::error;
use rand as _; // Required to make lints happy
use aquamarine as _; // doc-helper crate
use funty as _; // doc-helper crate
@@ -222,7 +223,11 @@ async fn main() -> Result<()> {
.await
.context("endpoint command failed")?
},
- Some((other, _)) => return Err(anyhow!("Unknown subcommand: {}", other)),
+ Some((other, _)) => {
+ error!("Unknown subcommand: {}", other);
+ error!("Use --help to find available subcommands");
+ return Err(anyhow!("Unknown subcommand: {}", other))
+ },
None => return Err(anyhow!("No subcommand")),
}