Re:Ask HN: How do you search for "-42" in Google?
by _delirium on Monday February 21, 2011 @05:00PM
(#2247409)
In GNU tools at least (not sure if others follow this convention?), the option '--' indicates that subsequent parameters aren't to be interpreted as options. For example, this lets you cd into a directory named '-foo':
[ Parent
| on HN ]
Re:Ask HN: How do you search for "-42" in Google?
by eklitzke on Monday February 21, 2011 @05:06PM
(#2247453)
This is a feature of GNU `getopt`, and I think it's supported by most BSD getopts. It's also recommended behavior by the SUS, see guideline 10: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_...
So it's not mandated, but it's the behavior of nearly all modern UNIX systems.
Re:Ask HN: How do you search for "-42" in Google?
by sophacles on Monday February 21, 2011 @07:24PM
(#2247995)
This is useful to know, and a great tip! I actually meant that "the OP question applies to searching for info about command line options as well". I find it amusing how your interpretation is equally valid. There is a lesson about clarity of communication here. :)
(also thanks for the reply, I appreciate it even tho it wasn't what I was looking for)