On 10 Nov 2002 12:45:07 +1100, Cameron Simpson wrote: > > On 20:33 09 Nov 2002, Mikhael Goikhman <[EMAIL PROTECTED]> wrote: > | On 09 Nov 2002 18:24:18 +0100, Dominik Vogt wrote: > | > > 3) We don't install any program to bindir without --help and --version. > | > And "-h", "-?" and "-V" please. In the long run I would like to > | > switch to GNU style long options. > | > | I think -V is a historical casus and it should better be -v, but let it > | be -V... But not -?, it is not even inputable in many shells, should be > | escaped as -\?. > > I beg to differ here. Well, not entirely, but slightly. > > My personal opinion is that a program should _always_ emit the usage > listing if it gets a bad option. The GNU behaviour of "bad option, tell > them to run with --help" enrages me. It is only sensible for programs > with very many options; most programs' usage listing will happily fit > on a single 24 lines screen. > > With that preamble, in my shells I expect to be able to go > > foo -? > > to most programs and get a usage message _because_ -? is not a valid > option. And I insist on my shells letting me type an unescaped -?, > and take care not to make stupidly named -* files.
You know, zsh and tcsh by default give you an error on unescaped -?. > So, what's I'm asking here is that: > - whether you implement an actual -? option doesn't > bug me, provided that _any_ bad option elicits the > full usage string It is good that you said GNU tells to print 2 lines only in this case, so I don't need to add more than several paragraphs of reasonings. :) I am against dumping the whole usage (that is usually more than 24 lines since all my programs are very configurable) every time a user makes a typo. A user wants to see that "option -X is not supported", he does not need to go several screens up to determine whether this option means "show usage" or it is unrecognized or maybe needs an additional argument. The only correct way to handle a bad option is to print 2 lines: program: unrecognized option '-o' (or: missing file argument after -o) Run --help to get the list of all recognized options. A user knows what he does if he specified -o option, he wants the result now. Or to see the diagnostic error line to know what he did wrong. He is not interested in anything forced like copyright/license/--version/--help. (In fact, IMHO the only place for copyrights is the man page and sources.) And I would prefer these two lines to be dumped to stderr like gcc does it and not stdout like gnome-terminal does it. Because stdout should contain the result of the program's run designed to be parsable/piped, an error option should not damage the expectations of the following piped program. It is ok for me that --help is dumped to stdout like GNU says, because in this case the usage screens are the output of the program, i.e. parsable. > - if you do implement -?, I request that it definitely > emits a usage message I will add the -? alias to all my scripts for everyone to be happy. :) It's a matter of adding 2 characters "|?" to a perl script or a module. In any case, I would not blindly follow all GNU "standards", only the reasonable ones. Even GNU projects do not follow all of them. Regards, Mikhael. -- Visit the official FVWM web page at <URL:http://www.fvwm.org/>. To unsubscribe from the list, send "unsubscribe fvwm-workers" in the body of a message to [EMAIL PROTECTED] To report problems, send mail to [EMAIL PROTECTED]