Re: unrecognized option '--help

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: unrecognized option '--help
Дата
Msg-id 20931.1432260522@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: unrecognized option '--help  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-bugs
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> If you have a database called --help you should probably still be able
> to connect to it using any of:

>   psql --dbname=--help
>   psql -d --help
>   psql -- --help

> I think it's perfectly reasonable to not recognize --help when it can be
> considered an argument to the previous option.

But then you have the problem that --help will only work if you spelled
everything to its left correctly, or at least close enough that getopt
doesn't see a problem with it.

I did have an evil thought about this ... what about recognizing --help
as either the first or last argument, but not in between?  That would
fix Alvaro's use-case, and for the 0.01% of cases where it's problematic,
I suspect it's always possible to rearrange the command so that the --help
argument doesn't have to be last.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: unrecognized option '--help
Следующее
От: Andres Freund
Дата:
Сообщение: Re: unrecognized option '--help