Collin Funk <[email protected]> writes:

>>     Now seeing that only three "Common options" do exist, it does not
>> seem to make sense that the printf page explicitly mentions only two
>> of them  ( --help , --version  ) but not the third ( -- ).
>>
>>
>> Obviously, these deficiencies exist in all languages/translations.
>
> This is a POSIX requirement for programs. Copying their words here [1]:
>
>     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.
>
> A common use of this is to delete file names that start with the "-"
> character. We have an example like this in the manual under the 'rm'
> command:
>
>     $ ls -- -f
>     -f
>     $ rm -f
>     $ ls -- -f
>     -f
>     $ rm -- -f
>     $ ls -- -f
>     ls: cannot access '-f': No such file or directory

I forgot to address your point about improving the documentation, sorry
about that.

I don't think it belongs in common options since it isn't really an
option.

Perhaps there is somewhere we can place it in the manual, so that it
doesn't rely on the user knowing about this POSIX rule and/or how
getopt(3) from libc works.

I'll think about it...

Thanks,
Collin



Reply via email to