mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 06:12:40 +00:00
docs(exmaples): Fix example to better align with intended use case
This commit is contained in:
parent
a9ccb3edb5
commit
d9081f3dce
1 changed files with 7 additions and 1 deletions
|
@ -10,5 +10,11 @@ fn main() {
|
|||
)
|
||||
.get_matches();
|
||||
|
||||
println!("name: {:?}", matches.get_one::<String>("name"));
|
||||
let args = matches
|
||||
.get_many::<String>("name")
|
||||
.unwrap_or_default()
|
||||
.map(|v| v.as_str())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
println!("names: {:?}", &args);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue