From e6464e7c2b38ad8a638307778f7d2b7dbeb7e180 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Fri, 11 Nov 2022 04:05:06 +0100 Subject: Fix clap 4 behavior when allowing duplicate args --- src/args.rs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/args.rs b/src/args.rs index e49fd9c..4ba5f24 100644 --- a/src/args.rs +++ b/src/args.rs @@ -50,19 +50,14 @@ pub struct CliArgs { short = 'i', long = "interfaces", value_parser(parse_interface), - num_args(1..), + num_args(1) )] pub interfaces: Vec, /// Set authentication. Currently supported formats: /// username:password, username:sha256:hash, username:sha512:hash /// (e.g. joe:123, joe:sha256:a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3) - #[arg( - short = 'a', - long = "auth", - value_parser(parse_auth), - num_args(1..) - )] + #[arg(short = 'a', long = "auth", value_parser(parse_auth), num_args(1))] pub auth: Vec, /// Use a specific route prefix @@ -152,11 +147,7 @@ pub struct CliArgs { pub title: Option, /// Set custom header for responses - #[arg( - long = "header", - value_parser(parse_header), - num_args(1..), - )] + #[arg(long = "header", value_parser(parse_header), num_args(1))] pub header: Vec, /// Visualize symlinks in directory listing -- cgit v1.2.3