From cafab9e9817bb5505567f988f6fe47998d1abbc5 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 22 Jan 2020 15:44:02 +0000 Subject: [PATCH] main: Add some command line argument conflicts Add explicit exclusions with --net-backend from --block-backend (and vice-versa.) And also with "--kernel" as this is the option for "VM boot" that is never optional. Ideally we would conflcit the backend arguments against the "vm-group" however this does not work as it includes some arguments that have a default value set and thus clap thinks those arguments are always provided. Conflicting with "--kernel" is thus a reasonable compromise. Signed-off-by: Rob Bradford --- src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.rs b/src/main.rs index 683e14d1c..5e36e5097 100755 --- a/src/main.rs +++ b/src/main.rs @@ -274,6 +274,7 @@ fn create_app<'a, 'b>( queue_size=\"", ) .takes_value(true) + .conflicts_with_all(&["block-backend", "kernel"]) .min_values(1), ) .arg( @@ -285,6 +286,7 @@ fn create_app<'a, 'b>( direct=true|false\"", ) .takes_value(true) + .conflicts_with_all(&["net-backend", "kernel"]) .min_values(1), ) }