-
I found some projects that made an update like: #[derive(Debug, Parser)]
pub struct S {
- #[clap(long)]
+ #[clap(long, action)]
pub output: Option<PathBuf>,
} But it looks like nothing different (for the execution result). What does the I'm also using clap on my project. So, I'd like to figure out how it works. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Huh, never documented this in the reference. #4043 fixes that. It opts you into clap v4's new semantics. In this particular example, it switches from the old default of |
Beta Was this translation helpful? Give feedback.
Huh, never documented this in the reference. #4043 fixes that.
It opts you into clap v4's new semantics. In this particular example, it switches from the old default of
ArgAction::StoreValue
toArgAction::Set
. It also implies#[clap(value_parser)]
which will cause thePathBuf
to not go through UTF-8 validation and will implicitly set the completions toValueHint::AnyPath
.