Bug 970 - document -- as option/non-option separator
Summary: document -- as option/non-option separator
Status: CLOSED WONTFIX
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Documentation (show other bugs)
Version: -current
Hardware: All Linux
: P2 enhancement
Assignee: OpenSSH Bugzilla mailing list
URL: http://bugs.debian.org/289401
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-11 10:54 AEDT by Colin Watson
Modified: 2006-10-07 11:38 AEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Watson 2005-01-11 10:54:22 AEDT
The OpenSSH utilities use getopt(), which according to
http://www.opengroup.org/onlinepubs/009695399/functions/getopt.html, manual
pages on the BSD and Linux systems I checked, and openbsd-compat/getopt.c, stops
scanning options when it encounters a "--". Greg Kochanski noted in a Debian bug
report that it's useful for reliable scripting purposes to be able to rely on
this feature, because it eliminates the possibility that a wildcard or a
variable expansion might expand to a valid option.

Since it seems generally useful and available, could this feature be documented?
Thanks.
Comment 1 Damien Miller 2005-01-11 13:24:40 AEDT
That is a standard feature of getopt(3) and therefore I don't think it needs
repeating in the documentation of every application that uses it.
Comment 2 Colin Watson 2005-01-11 13:40:12 AEDT
I view it as pretty similar to saying that options start with '-'; a small thing
and absolutely standard, but it would be very confusing to leave it out. In any
case, so many programs roll their own option parsing in one way or another that
I don't think it's unreasonable that a user wouldn't be sure that ssh uses
getopt without going and grovelling through the source.

If you don't want to repeat it, perhaps at least refer to getopt(3) (though it's
not wonderful user-level documentation) so that it's clear that ssh uses it?
Comment 3 Darren Tucker 2006-10-07 11:38:29 AEST
Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4.