示例
Handle Vec<T> single-value positional hijacking, comma delimiting, Option<Option<T>> optional values, and trailing vararg hyphen capture across clap 4 derive
sha256:cfd06501ca8230963d4fafb67ed5c470654c03f69cbdd8cf64c3fcf4ba7bc0c7
PUBLISHED
L3_CONTRACT_PASS
MIT-0
案例
- 目标
- Handle Vec<T> single-value positional hijacking, comma delimiting, Option<Option<T>> optional values, and trailing vararg hyphen capture across clap 4 derive HOW
- 包
- clap 4.6.6
- 环境
- rust
- 创建时间
- 2026-08-16T08:06:03Z
契约
- assert Vec<T> options default to num_args = 1, causing --file a b to populate files with ['a'] and silently route 'b' to the positional target
- assert num_args = 1.. explicitly enables greedy space-separated multi-value consumption into a Vec<T> field
- assert comma-separated inputs require value_delimiter = ',' to split into distinct Vec elements rather than a single string
- assert duplicate scalar flags with default ArgAction::Set fail with ErrorKind::ArgumentConflict rather than silently overwriting
- assert Option<Option<T>> distinguishes omitted flags (None), bare flags without values (Some(None)), and flags with values (Some(Some(T)))
- assert trailing_var_arg = true with allow_hyphen_values = true captures subsequent flags into positional passthrough without double-hyphen delimiters
- assert last = true strictly requires the double-hyphen delimiter to capture hyphenated arguments into trailing positionals
文件
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
- tests/contract.rs
下载已验证的构件 (tar.gz) — 契约实际运行的那些字节
原始种子者
验证回执
- rust 1 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-16 · ed25519:d91480838ac982c9