From deb4ad5e2373c6bcde1990c9786291af002387f0 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 4 Aug 2021 14:36:47 +0000 Subject: [PATCH] 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 --- vhost_user_block/src/main.rs | 2 +- vhost_user_net/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vhost_user_block/src/main.rs b/vhost_user_block/src/main.rs index c1e589770..79ad1aeac 100644 --- a/vhost_user_block/src/main.rs +++ b/vhost_user_block/src/main.rs @@ -25,7 +25,7 @@ fn main() { .long("block-backend") .help(vhost_user_block::SYNTAX) .takes_value(true) - .min_values(1), + .required(true), ) .get_matches(); diff --git a/vhost_user_net/src/main.rs b/vhost_user_net/src/main.rs index e5457b388..91c027539 100644 --- a/vhost_user_net/src/main.rs +++ b/vhost_user_net/src/main.rs @@ -22,7 +22,7 @@ fn main() { .long("net-backend") .help(vhost_user_net::SYNTAX) .takes_value(true) - .min_values(1), + .required(true), ) .get_matches();