vhost_user_*: mark --*-backend as required

I don't think the min_values(1) was doing anything, since
takes_value(true) was already set, and after this change I still get
an error if I try to supply the argument with no value.

But the unwrap below would fail if the argument wasn't supplied at
all.  By setting required(true) we get a nice message from clap
instead.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
This commit is contained in:
Alyssa Ross 2021-08-04 14:36:47 +00:00 committed by Sebastien Boeuf
parent 3dff598fa2
commit deb4ad5e23
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ fn main() {
.long("block-backend") .long("block-backend")
.help(vhost_user_block::SYNTAX) .help(vhost_user_block::SYNTAX)
.takes_value(true) .takes_value(true)
.min_values(1), .required(true),
) )
.get_matches(); .get_matches();

View File

@ -22,7 +22,7 @@ fn main() {
.long("net-backend") .long("net-backend")
.help(vhost_user_net::SYNTAX) .help(vhost_user_net::SYNTAX)
.takes_value(true) .takes_value(true)
.min_values(1), .required(true),
) )
.get_matches(); .get_matches();