New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ordering between flag
and flag_if_supported
is not maintained
#855
Comments
As far as fixing this is concerned, I imagine we would maintain some sort of a per-Builder sequence index that gets associated with each flag pushed to one of the many vectors that are used to maintain these flags. So instead of We could also replace the many vectors with a vector of enum variants each representing different kind of flag. Worth noting that changing this would be a breaking change, so it'd be worthwhile to see if we want to or are willing change the behaviour here at all. |
You mean it would be breaking to fix the ordering because someone might be relying on us using the current order? I suppose that's true, but I'm not worried about it. We never wrote down that this is the behavior, and this isn't a crate where we'd get anything done if we preserved Hyrum-esque stability promises. I think I'd take a PR for this if it was reasonably implemented. I don't have a strong opinion between enum vs |
That too, but especially that now
will test whether appending |
C and C++ compilers consider the ordering of arguments important and semantic. However, if you construct a builder like this:
the constructed command line will look like this:
which will then error (or warn...), even though the otherwise nonsensical, but valid invocation would be
Some valid use-cases of this ordering generally involve overriding previous arguments.
The text was updated successfully, but these errors were encountered: