pg_ctl and -h/help

Lists: pgsql-hackers
From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: pg_ctl and -h/help
Date: 2013-06-29 13:45:46
Message-ID: 20130629134546.GB23294@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

In studying pg_upgrade's handling of --help, I noticed that pg_ctl
supports -h for help, but it is the only tool to do so, and -h is not
documented. I propose we remove -h for help in pg_ctl, and have it
support only -? and --help.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_ctl and -h/help
Date: 2013-06-30 05:29:20
Message-ID: CAB7nPqSRe-bn48Q50g-m-DYodA0esjg3gp_HKSQmQ5fQ4W5oEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Jun 29, 2013 at 10:45 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> In studying pg_upgrade's handling of --help, I noticed that pg_ctl
> supports -h for help, but it is the only tool to do so, and -h is not
> documented. I propose we remove -h for help in pg_ctl, and have it
> support only -? and --help.
I suppose that it doesn't hurt to have it, but for yes the sake of
consistency with the other binaries it would make sense to remove it.
Btw, not even the docs, it is also not listed in the --help message
findable in code.
--
Michael


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_ctl and -h/help
Date: 2013-07-01 16:43:32
Message-ID: 20130701164332.GA16348@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, Jun 30, 2013 at 02:29:20PM +0900, Michael Paquier wrote:
> On Sat, Jun 29, 2013 at 10:45 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > In studying pg_upgrade's handling of --help, I noticed that pg_ctl
> > supports -h for help, but it is the only tool to do so, and -h is not
> > documented. I propose we remove -h for help in pg_ctl, and have it
> > support only -? and --help.
> I suppose that it doesn't hurt to have it, but for yes the sake of
> consistency with the other binaries it would make sense to remove it.
> Btw, not even the docs, it is also not listed in the --help message
> findable in code.

Agreed --- attached patch applied. I also noticed that we sometimes
test for -? then --help, but other times do things in the opposite
order, and the same for -V/--version, so I made that consistent.

However, I also noticed that while we document -? before --help, we test
for --help before -?, and the same for -V/--version. Should I make
those even more consistent by always testing for the single-letter
option first?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Attachment Content-Type Size
help.diff text/x-diff 3.0 KB

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_ctl and -h/help
Date: 2013-07-01 22:27:06
Message-ID: CAB7nPqTyUcY4k0iBg0vdbBP2C6bA0ucxKHcm4PV7e72jMCikOQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jul 2, 2013 at 1:43 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> Agreed --- attached patch applied. I also noticed that we sometimes
> test for -? then --help, but other times do things in the opposite
> order, and the same for -V/--version, so I made that consistent.
>
> However, I also noticed that while we document -? before --help, we test
> for --help before -?, and the same for -V/--version. Should I make
> those even more consistent by always testing for the single-letter
> option first?
I am not sure if this is worth doing for all the binaries, the output
result and the return code being the same in all the cases. Having an
undocumented -h was somehow different because it caused the spec of
pg_ctl and friends to behave differently than what was documented. My
2c.
--
Michael