Crystal: OptionParser: Add support for long options with single dash

Created on 6 Jun 2019  路  6Comments  路  Source: crystal-lang/crystal

Example

mpv -shuffle .
feature discussion stdlib

Most helpful comment

That would trouble stacking several short options together (possibly future feature):
foo -a -b -c -> foo -abc

All 6 comments

That would trouble stacking several short options together (possibly future feature):
foo -a -b -c -> foo -abc

IMO very, very, very bad idea. It would go against all established common idioms, and the only piece of software which does that is Java. Not sth we'd like to follow IMO.

In most languages that offer this, it's optional and comes with special behavior (most notably, you can type only part of the option and it'll automatically expand to the full one). Most notably, I believe Go uses this style by default.

I don't think we'll add this to OptionParser. You can always roll your own option parsing mechanism which supports single dash long options.

just create your own parser/method to support this with ARGV

Shall we close it?

Was this page helpful?
0 / 5 - 0 ratings