Skip to content

Commit 5f206a6

Browse files
committed
fix: clap cannot downcast CLI flags to PathBuf
After the recent changes clap is not able to cast the CLI flags into PathBuf type. To fix that, we can configure the value parser when the Arg is created. Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
1 parent aecaeba commit 5f206a6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/cli.rs

+3
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,22 @@ pub(crate) fn build_cli() -> Command {
8585
.long("cert-file")
8686
.value_name("CERT_FILE")
8787
.env("KUBEWARDEN_CERT_FILE")
88+
.value_parser(clap::builder::PathBufValueParser::new())
8889
.help("Path to an X.509 certificate file for HTTPS"),
8990

9091
Arg::new("key-file")
9192
.long("key-file")
9293
.value_name("KEY_FILE")
9394
.env("KUBEWARDEN_KEY_FILE")
95+
.value_parser(clap::builder::PathBufValueParser::new())
9496
.help("Path to an X.509 private key file for HTTPS"),
9597

9698
Arg::new("client-ca-file")
9799
.long("client-ca-file")
98100
.value_delimiter(',')
99101
.value_name("CLIENT_CA_FILE")
100102
.env("KUBEWARDEN_CLIENT_CA_FILE")
103+
.value_parser(clap::builder::PathBufValueParser::new())
101104
.help("Path to an CA certificate file that issued the client certificate. Required to enable mTLS"),
102105

103106
Arg::new("policies")

0 commit comments

Comments
 (0)