How do I use num_args with different types using derive #5102
Unanswered
headhunter45
asked this question in
Q&A
Replies: 1 comment
-
At this time, we do not support arguments of different types like this. The biggest limitation is in how we parse and store this information for then putting in your struct. #1717 is the issue for this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm looking for something like this where the argument is "status", it takes 2 values of different types, and it can appear more than once. This is a minimal example, but my actual use is more complicated. I have other subcommands and a few other possible arguments.
I'm looking for a way to have an argument that takes two values of different types and what I should store them as using derive.
I was thinking a HashMap at first, but that didn't work. It also wouldn't work if num_args was anything else than two. Maybe something like Vec<(Category,Status)>?
Beta Was this translation helpful? Give feedback.
All reactions