mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35:20 +00:00
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:
parent
5627c26405
commit
0310c5726f
@ -898,6 +898,7 @@ fn main() {
|
|||||||
.author(env!("CARGO_PKG_AUTHORS"))
|
.author(env!("CARGO_PKG_AUTHORS"))
|
||||||
.version(env!("BUILD_VERSION"))
|
.version(env!("BUILD_VERSION"))
|
||||||
.about("Remotely control a cloud-hypervisor VMM.")
|
.about("Remotely control a cloud-hypervisor VMM.")
|
||||||
|
.arg_required_else_help(true)
|
||||||
.subcommand_required(true)
|
.subcommand_required(true)
|
||||||
.args([
|
.args([
|
||||||
Arg::new("api-socket")
|
Arg::new("api-socket")
|
||||||
|
@ -156,6 +156,7 @@ fn create_app(default_vcpus: String, default_memory: String, default_rng: String
|
|||||||
// compile time
|
// compile time
|
||||||
.author(env!("CARGO_PKG_AUTHORS"))
|
.author(env!("CARGO_PKG_AUTHORS"))
|
||||||
.about("Launch a cloud-hypervisor VMM.")
|
.about("Launch a cloud-hypervisor VMM.")
|
||||||
|
.arg_required_else_help(true)
|
||||||
.group(ArgGroup::new("vm-config").multiple(true))
|
.group(ArgGroup::new("vm-config").multiple(true))
|
||||||
.group(ArgGroup::new("vmm-config").multiple(true))
|
.group(ArgGroup::new("vmm-config").multiple(true))
|
||||||
.group(ArgGroup::new("logging").multiple(true))
|
.group(ArgGroup::new("logging").multiple(true))
|
||||||
|
@ -20,6 +20,7 @@ fn main() {
|
|||||||
.version(env!("CARGO_PKG_VERSION"))
|
.version(env!("CARGO_PKG_VERSION"))
|
||||||
.author(env!("CARGO_PKG_AUTHORS"))
|
.author(env!("CARGO_PKG_AUTHORS"))
|
||||||
.about("Launch a vhost-user-blk backend.")
|
.about("Launch a vhost-user-blk backend.")
|
||||||
|
.arg_required_else_help(true)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("block-backend")
|
Arg::new("block-backend")
|
||||||
.long("block-backend")
|
.long("block-backend")
|
||||||
|
@ -16,6 +16,7 @@ fn main() {
|
|||||||
.version(env!("CARGO_PKG_VERSION"))
|
.version(env!("CARGO_PKG_VERSION"))
|
||||||
.author(env!("CARGO_PKG_AUTHORS"))
|
.author(env!("CARGO_PKG_AUTHORS"))
|
||||||
.about("Launch a vhost-user-net backend.")
|
.about("Launch a vhost-user-net backend.")
|
||||||
|
.arg_required_else_help(true)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("net-backend")
|
Arg::new("net-backend")
|
||||||
.long("net-backend")
|
.long("net-backend")
|
||||||
|
Loading…
Reference in New Issue
Block a user