-h, --help option

William Ahern william at 25thandClement.com
Wed Jun 25 05:56:49 EST 2014


On Tue, Jun 24, 2014 at 09:53:42PM +0300, anatoly techtonik wrote:
> On Tue, Jun 24, 2014 at 7:24 PM, Darren Tucker <dtucker at zip.com.au> wrote:
> > On Tue, Jun 24, 2014 at 10:08 AM, anatoly techtonik <techtonik at gmail.com>
> > wrote:
> >>
> >> Enough work? Is the main problem in that ssh option parsing code doesn't
> >> support long options and doing this in C in cross-platform manner doesn't
> >> worth the development time?
> >
> > Long options are a non-standard GNU extension.  OpenSSH aims to be a POSIX
> > program.  See
> > http://pubs.opengroup.org/onlinepubs/009695399/functions/getopt.html and
> > http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
> 
> Do GNU/POSIX standards evolve? If not, is there any more modern standard that
> includes these? I am worried, because --help is a standard option for any Python
> program, so no Python program can be POSIX compliant.

OpenSSH uses chroot, which is technically a BSD extension not in POSIX. I
personally wouldn't characterize getopt_long as a GNU extension, considering
how widely it's supported. All the open source POSIX-compliant and
POSIX-aspiring platforms support it. OpenBSD added it in 2002. Solaris has
it. AFAIK the only widely used Unix systems that don't implement it are AIX,
HP-UX, and QNX. But freely licensed (non-GPL versions) abound. And like
chroot I expect getopt_long to continue spreading.

Unlike chroot, though, supporting getopt_long is alot of hassle for little
benefit. _Especially_ considering that the developers don't see much value
in even supporting getopt.

That getopt_long isn't in POSIX is almost beside the point, and maybe the
reply was just a polite way to end the discussion with an indisputable
counter-argument. And what Python does is irrelevant to OpenSSH and its
goals.

However, if you want to champion getopt_long's introduction to POSIX, feel
free. POSIX is a still being developed, and they're still taking feature
requests for Issue 8. I couldn't find a ticket for getopt_long at
austingroupbugs.net. But you should inquire with someone more familiar with
the process before opening a ticket.

> Are there any modern initiatives to develop standard like POSIX. Modern means
> backed up with latest UX research that emerged in the last decade?
> 
> >> Maybe the problem is that people are not interested to do this work,
> >> because it simply doesn't affect them?
> >  More like people disagree with you that it should be done.
> 
> Right. There are only two replies and it is always hard to persuade my stats
> senses that the selection is representative even if there are no reasons to
> doubt.

That nobody else is speaking up speaks volumes, I think. If a long-time
maintainer says that it's not worthwhile, then why continue arguing after
all the chips are on the table? Maybe the project will change its mind down
the road, but in the meantime you should probably accept the answer you got.

Also, it's usually poor form to request a feature without also offering a
patch, even if the patch is just a jumping off point. Without actually
editing the code you have no perspective regarding the relative costs.

> > from upthread:
> >>
> >> HTML pages are more usable than man, just because we are all familiar with
> >> browsers and know where is their search button.
> >
> > Try http://www.openbsd.org/cgi-bin/man.cgi?query=ssh&sektion=1
> 
> StackOverflow is better and more Google friendly. =)

I'm sure that the OpenSSH maintainers don't believe Stack Overflow to be a
preferable resource to the manual page. Personally I think it's a poor habit
to consult such a forum before consulting the documentation. Stack Overflow
is rife with cargo culting.

That said, if you care to visit Usenet I believe there are some people who
work on POSIX who read comp.unix.programmer. They may also post on Stack
Overflow for all I know, but comp.unix.programmer is a more reliable and
trustworthy forum with more in-depth discussions. In 10 years I expect Stack
Overflow to be effectively gone, replaced by some other website, but
comp.unix.programmer to still be active.


More information about the openssh-unix-dev mailing list