'How do you maintain the order of arguments?
I have a set of rust programs for which the order of arguments is important, e.g.
mytool --foo this --bar that
is not the same as
mytool --bar that --foo this
I'd really like to simply iterate the args from left to right, but clap does an excellent job of abstracting that away.
I'd even be willing to iterate all the args and, using indices_of, generate an ordered Vec of arguments and then process that, but I don't think clap provides a way to iterate all the args in any order. I'll have a rather large set of rather complex command lines, so I'd rather not have to repeat the list of argument names.
I'd like to keep all the great things that clap does, but I really need to know the ordering of the input.
Any advice?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
