With the old arg iterator I enjoyed using the index field to "rewind" the iterator to a previous argument while parsing options for CLIs. I can't see how to achieve this with the new implementation.
- Any suggestions on how to replicate this, while keeping the iterator pattern?
- Is there a "hard" reason for this change? Could it be reversed if my use-case proves worthwhile?
An example:
```ts
var args = std.process.ArgIteratorPosix.init();
const progname = args.next();
// Parse options
while (args.next()) |arg| {
// THIS: If arg isn't an option, rewind to process it again
if (arg[0] != '-') {
args.index -= 1;
break;
}
}
// Process file arguments
while (args.next()) |path| {
...
}