Bug 970

Summary: document -- as option/non-option separator
Product: Portable OpenSSH Reporter: Colin Watson <cjwatson>
Component: DocumentationAssignee: OpenSSH Bugzilla mailing list <openssh-bugs>
Status: CLOSED WONTFIX    
Severity: enhancement    
Priority: P2    
Version: -current   
Hardware: All   
OS: Linux   
URL: http://bugs.debian.org/289401

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.