Re:Unix Wildcards Gone Wild
by teddyh on Sunday August 17, 2014 @05:35PM
(#8190541)
The double dash -- to stop option parsing is not a GNU thing – it comes from the POSIX standard.
[ Parent
| on HN ]
Re:Unix Wildcards Gone Wild
by AceJohnny2 on Sunday August 17, 2014 @05:43PM
(#8190569)
Thanks! I had always figured that, along with long options, they were a GNU thing.
There's some digging here: http://unix.stackexchange.com/questions/147143/when-and-how-...
Looks like the convention was introduced as part of getopt in AT&T Unix System III (1980), though initially only in a handful of places. Then POSIX adopted it as standard for all utilities sometime later.
They were quite distinct.
When --longopt was starting to get popular (in an ad-hoc way) for gnu and other utilities there was a poll (gnu.misc? late 90s?) whether to make it a gnu standard. The other choices were a +, or have commands not accept both bundled single letter options and longopts. There may have been other choices I've forgotten about.
The double-dash won. There were some people who were concerned that it might be confused with the end-of-args double dash.
Maybe that is true but they are certainly unambiguously parsed.