I'm trying to dispel this uncertainty I have about the use of the double-dash (two hyphens, --) as an end of options delimiter(as opposed to a long option prefix). It's possible some confusion arose when someone read that long options are a GNU convention and long options begin with --. But this is just unrelated to the end of option delimiter.
The usage of Which is fully compliant with IEEE Std 1003.1, 2013 Utility Syntax Guideline 10:
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.
So one can look at the rm manpages for OSX(or FreeBSD), AIX, Solaris and HPUX - the well known UNIX '03 registered Unices:
- OSX, AIX and Solaris1 refer to the
--delimiter verbatim in man rm - HPUX doesn't discuss it in man rm but has other commands which allow the said delimiter(such as
touch)
Is there a single UNIX 03 registered product which can't do rm -- -foo today? Is it Solaris... HPUX? Can they do it even though they don't document it? Can we generalize this to all commands on those platforms at this point?
1. The Solaris 11 manual says in a final note: If a - - and a - both appear on the same command line, the second is interpreted as a file. And there is a space in between the first two hyphens. Is it just the hyphen or anything that would start with the hyphen in this context which would be interpreted as a file?