From f54ca68ecd6c8ffc6a6e0d6ef8abd6e2f1980eda Mon Sep 17 00:00:00 2001 From: boaz-quotient <109082044+boaz-quotient@users.noreply.github.com> Date: Wed, 26 Apr 2023 19:48:24 +0300 Subject: [PATCH] Override log opt when specified more than once (#1847) * Override log opt when specified more than once Signed-off-by: Boaz Shuster * Add a comment about the log flag "override" behavior Signed-off-by: Boaz Shuster --------- Signed-off-by: Boaz Shuster Co-authored-by: Boaz Shuster --- crates/liboci-cli/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/liboci-cli/src/lib.rs b/crates/liboci-cli/src/lib.rs index 48fb9d46..85da8b52 100644 --- a/crates/liboci-cli/src/lib.rs +++ b/crates/liboci-cli/src/lib.rs @@ -70,7 +70,8 @@ pub struct GlobalOpts { // Example in future : '--debug change log level to debug. (default: "warn")' #[clap(long)] pub debug: bool, - #[clap(short, long)] + // Set a consistent behavior like in runc and crun: set log to the last given value + #[clap(short, long, overrides_with("log"))] pub log: Option, #[clap(long)] pub log_format: Option,