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

It disambiguates multiple short flags from a long flag. Ie. if the program happened to have short flags l, o, n, g, and l could also be the whole word long, which would

    -long
mean?


For example, single hyphens are stackable.

For example, this: http://explainshell.com/explain?cmd=tar+-z+-c+-f

Is the same as: http://explainshell.com/explain?cmd=tar+-zcf

But trying to stack double-dashed arguments would be stupid: http://explainshell.com/explain?cmd=tar+--helpversion


> For example, this: http://explainshell.com/explain?cmd=tar+-z+-c+-f

> Is the same as: http://explainshell.com/explain?cmd=tar+-zcf

Which is also the same as http://explainshell.com/explain?cmd=tar+zcf because of the unique way tar treats argv[1].




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

Search: