Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

AFAIK it's all about trying to be POSIX-but-not-quite. Via the POSIX spec https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1... :

> The first -- argument that is not an option-argument should be accepted as a delimiter indicating the end of options. Any following arguments should be treated as operands, even if they begin with the '-' character.

> All options should precede operands on the command line.

> If an argument can be identified according to Guidelines 3 through 10 as an option, or as a group of options without option-arguments behind one '-' delimiter, then it should be treated as such.

I think that the rule "all options should precede operands" has been broken so much in practice (particularly since any subcommand must break it) that it may as well not be a rule. And if it's not a rule, then the only way to unambiguously distinguish options from operands-that-start-with-a-dash-but-should-be-passed-verbatim-as-operands... is to require a double-dash.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: