Re: unrecognized option '--help - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: unrecognized option '--help
Date
Msg-id CAB7nPqQx4pSMt=0qshQd630+nR0nKNTrxG_H2Xj8dQL2wQ6UVg@mail.gmail.com
Whole thread Raw
In response to Re: unrecognized option '--help  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List 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 by date:

Previous
From: Michael Paquier
Date:
Subject: Re: unrecognized option '--help
Next
From: Fabien COELHO
Date:
Subject: Re: BUG #12379: pgbench should hint to pgbench -i