main: Show help text when run without arguments

cloud-hypervisor, ch-remote, vhost-user-block and vhost-user-net all
need at least one argument to do anything useful, so printing command
help is helpful when they are run without arguments or a subcommand.

Use clap::Command::arg_required_else_help(true) to do this.

Signed-off-by: Chris Webb <chris@arachsys.com>
This commit is contained in:
Chris Webb 2024-02-23 22:38:12 +00:00 committed by Rob Bradford
parent 5627c26405
commit 0310c5726f
4 changed files with 4 additions and 0 deletions

View file

@ -16,6 +16,7 @@ fn main() {
.version(env!("CARGO_PKG_VERSION"))
.author(env!("CARGO_PKG_AUTHORS"))
.about("Launch a vhost-user-net backend.")
.arg_required_else_help(true)
.arg(
Arg::new("net-backend")
.long("net-backend")