PATCH: optparse: add keep_unknown option
Currently people have to do very convoluted tricks, essentially making
it impossible for optparse to keep unknown options.
The safest and cleanest way is to do it in the code itself.
#3 Updated by Ilya Vorontsov over 1 year ago
Can anyone please take a look at a bug http://bugs.ruby-lang.org/issues/7537#change-37695 considering command-line arguments containing negative numbers (which're erroneously treated ass options) and my patch for it.
I'm afraid that keeping unknown options will silently treat negative numbers (not an exception is raised) and possibly lose their ordering. So please before accepting unknown options patch, decide which behavior for such a case is right and make a specification about negative numbers in command line(as an example, they may became non-options and in such a case this proposal will work differently).
In my bug report and a patch I proposed some specs for optparse behavior in this case, but they weren't yet accepted or declined.