From 5627c26405399a511af1eadb3a3ffa4ac8c1cde0 Mon Sep 17 00:00:00 2001 From: Chris Webb Date: Fri, 23 Feb 2024 16:55:12 +0000 Subject: [PATCH] ch-remote: Fix crash when run with no subcommand ch-remote crashes when run with --api-socket but no subcommand: $ target/release/ch-remote --api-socket /tmp/api thread 'main' panicked at src/bin/ch-remote.rs:509:14: internal error: entered unreachable code Use clap::Command::subcommand_required(true) to yield a more friendly error in this case. Signed-off-by: Chris Webb --- src/bin/ch-remote.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/ch-remote.rs b/src/bin/ch-remote.rs index 1d5d5d0ba..f9236e375 100644 --- a/src/bin/ch-remote.rs +++ b/src/bin/ch-remote.rs @@ -898,6 +898,7 @@ fn main() { .author(env!("CARGO_PKG_AUTHORS")) .version(env!("BUILD_VERSION")) .about("Remotely control a cloud-hypervisor VMM.") + .subcommand_required(true) .args([ Arg::new("api-socket") .long("api-socket")