Re: unrecognized option '--help

Поиск
Список
Период
Сортировка
Искать
От
Andres Freund
Тема
Re: unrecognized option '--help
Дата
в 02:13:25
Msg-id
20150522021319.GG2028@alap3.anarazel.de
Ответ на
Список
Дерево обсуждения
unrecognized option '--help "D. S." <spider@skuggor.se>
Re: unrecognized option '--help Devrim Gündüz <devrim@gunduz.org>
Re: unrecognized option '--help "D. Spindel" <spider@skuggor.se>
Re: unrecognized option '--help Michael Paquier <michael.paquier@gmail.com>
Re: unrecognized option '--help Alvaro Herrera <alvherre@2ndquadrant.com>
Re: unrecognized option '--help Andres Freund <andres@anarazel.de>
Re: unrecognized option '--help Tom Lane <tgl@sss.pgh.pa.us>
Re: unrecognized option '--help Andres Freund <andres@anarazel.de>
Re: unrecognized option '--help Tom Lane <tgl@sss.pgh.pa.us>
Re: unrecognized option '--help Andres Freund <andres@anarazel.de>
Re: unrecognized option '--help Tom Lane <tgl@sss.pgh.pa.us>
Re: unrecognized option '--help Alvaro Herrera <alvherre@2ndquadrant.com>
Re: unrecognized option '--help Michael Paquier <michael.paquier@gmail.com>
Re: unrecognized option '--help Michael Paquier <michael.paquier@gmail.com>
Re: unrecognized option '--help Alvaro Herrera <alvherre@2ndquadrant.com>
Re: unrecognized option '--help Tom Lane <tgl@sss.pgh.pa.us>
On 2015-05-21 21:59:56 -0400, Tom Lane wrote:
> As I recall, Alvaro's argument for this was "I typed multiple words of a
> command and then want to check syntax, so I add --help to the end of what
> I'd already typed and hit return, with the idea of recalling the command
> and deleting the --help off the end so I don't have to retype what I
> already entered."

Something around that, yes.

> This use-case is only going to work reliably if --help is recognized
> regardless of what's in front of it.  Otherwise, if you're right in
> suspecting that you got something wrong, getopt parsing will fail
> before it gets to your --help --- and what it will print is "please
> use --help", which is exactly the symptom being complained of here.

I don't think it really is the symptom complained about here. Right now
"vacuumdb dbname --verbose" works (i.e. recognizes verbose as an
option), whereas "vacuumdb dbname --help" doesn't. The latter is what's
complained about here. And the reason for that is that
--help/-?/--version/-v aren't part of the getopt_long() call.

Sure, vacuumdb --dbname --help or something like that isn't going to
work, but I think that's fairly minor in comparison to the above. And
much easier to understand.

> As I said, maybe that's okay.  It'd certainly be 99.99% okay ... but
> the other hundredth of a percent could be pretty painful.

I can't see how treating it like the other options we already have could
make it more painful?

Greetings,

Andres Freund
В списке pgsql-bugs по дате отправления
От: Tom Lane
Дата:
От: Tom Lane
Дата:
FAQ