Re: unrecognized option '--help

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: unrecognized option '--help
Дата
Msg-id CAB7nPqQx4pSMt=0qshQd630+nR0nKNTrxG_H2Xj8dQL2wQ6UVg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: unrecognized option '--help  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-bugs
On Fri, May 22, 2015 at 12:59 PM, Alvaro Herrera wrote:
> Tom Lane wrote:
>> Note that we should not rip out the existing code, because part of the
>> reason for that is that it acts before any of the other stuff that runs
>> before getopt parsing starts, eg the postmaster's refusal to run if you're
>> root.
>
> No objection to that, though I wonder (without looking at the code) if
> for binaries other than postmaster this is really worthwhile.

I would plead for consistency in this area, aka moving the root check
before the option parsing for all the utilies, still check --help and
--version are argv[1] (or argv[optind]), and move them as well in
getopt_long parsing to get cleaner error messages be one of them
mentioned. I can believe that some people may want to have quick looks
at --help or --version even when running a binary utility as root even
if it is not permitted to run under such circumstances.
--
Michael

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: unrecognized option '--help
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: BUG #12379: pgbench should hint to pgbench -i