Re: pgbench: improve --help and --version parsing

2018-11-28 Thread Kyotaro HORIGUCHI
Hello. Sorry for not getting into this but I'm looking forward to this. (I'm tired to insert '--help' to the top of argument list..) This patch still applies to the current master but ecpg.c. At Sun, 22 Jul 2018 16:13:20 -0400 (EDT), Fabien COELHO wrote in > > Hello > > My 0.02€: > > > Tha

Re: pgbench: improve --help and --version parsing

2018-07-26 Thread Michael Paquier
On Thu, Jul 26, 2018 at 06:42:02PM -0400, Fabien COELHO wrote: > Ok, if you remove tests, it can be done in less tests, obviously. Well, if we can find a way to reduce the number of tests but not their coverage, that's always welcome. > ISTM that some minimal sanity on the output would be useful.

Re: pgbench: improve --help and --version parsing

2018-07-26 Thread Fabien COELHO
I do not understand what you mean by "reduce that to one single test". I cannot see how to test stdouts equalities and contents' sanity in one single test. I was wondering about reducing the number of tests to a strict minimum. At the end I think that I would just remove most of the tests you

Re: pgbench: improve --help and --version parsing

2018-07-26 Thread Michael Paquier
On Thu, Jul 26, 2018 at 06:22:16PM -0400, Fabien COELHO wrote: > I do not understand what you mean by "reduce that to one single test". I > cannot see how to test stdouts equalities and contents' sanity in one single > test. I was wondering about reducing the number of tests to a strict minimum. A

Re: pgbench: improve --help and --version parsing

2018-07-26 Thread Fabien COELHO
Hello Michaël, Do you mean something like the attached? You basically have the idea, except that the number of tests in any TAP files calling program_help_ok and program_version_ok Indeed. I wanted to outline the perl module part, really. needs to be updated, and that the test is too verb

Re: pgbench: improve --help and --version parsing

2018-07-23 Thread Michael Paquier
On Mon, Jul 23, 2018 at 07:47:44AM -0400, Fabien COELHO wrote: >> I don't think that it is a bad idea to improve things the way you are > > For the record, this is not my patch, I'm merely reviewing it. Of course, any input is welcome. It is nice to see that you took some time to look at the pat

Re: pgbench: improve --help and --version parsing

2018-07-23 Thread Fabien COELHO
Hello Michaël, I doubt that -V & -? are heavily tested:-) Patch works for me, though. They are not, and the patch misses this area. Indeed. I don't think that it is a bad idea to improve things the way you are For the record, this is not my patch, I'm merely reviewing it. doing, howeve

Re: pgbench: improve --help and --version parsing

2018-07-22 Thread Michael Paquier
On Sun, Jul 22, 2018 at 10:19:50AM -0400, Fabien COELHO wrote: >> Agreed. I have changed handling of the --help and --version options in all >> apps >> where it exhibits the problem described, with the exception for >> pg_archivecleanup >> where getopt is used instead of getopt_long. The separate

Re: pgbench: improve --help and --version parsing

2018-07-22 Thread Fabien COELHO
Hello My 0.02€: Thanks! I made the same modification of src/interfaces/ecpg/preproc/ecpg.c, but in other cases it's either not a problem (as with src/bin/psql/startup.c or src/timezone/zic.c) or the solution is too complex to be added to the current patch: e.g. these tools in src/bin/scripts u

Re: pgbench: improve --help and --version parsing

2018-07-22 Thread Andrei Korigodski
Fabien COELHO writes: > There seems to be other instances as well Thanks! I made the same modification of src/interfaces/ecpg/preproc/ecpg.c, but in other cases it's either not a problem (as with src/bin/psql/startup.c or src/timezone/zic.c) or the solution is too complex to be added to the curre

Re: pgbench: improve --help and --version parsing

2018-07-22 Thread Fabien COELHO
Agreed. I have changed handling of the --help and --version options in all apps where it exhibits the problem described, with the exception for pg_archivecleanup where getopt is used instead of getopt_long. The separate patch will be proposed to address it. The patch is against current master

Re: pgbench: improve --help and --version parsing

2018-07-22 Thread Andrei Korigodski
Tom Lane writes: > Andres Freund writes: > > On July 21, 2018 11:15:51 PM PDT, Tom Lane wrote: > > > This is, in fact, how it's done in all PG apps. > > Think there's a fair argument that we should improve that at some point... > Perhaps.  Peter E. might remember why it's like that. It was done

Re: pgbench: improve --help and --version parsing

2018-07-22 Thread Andres Freund
On July 21, 2018 11:52:05 PM PDT, Tom Lane wrote: >But I'm dubious >about changing it in only one app. Agreed. -- Sent from my Android device with K-9 Mail. Please excuse my brevity.

Re: pgbench: improve --help and --version parsing

2018-07-21 Thread Tom Lane
Andres Freund writes: > On July 21, 2018 11:15:51 PM PDT, Tom Lane wrote: >> This is, in fact, how it's done in all PG apps. > Think there's a fair argument that we should improve that at some point... Perhaps. Peter E. might remember why it's like that. But I'm dubious about changing it in o

Re: pgbench: improve --help and --version parsing

2018-07-21 Thread Andres Freund
On July 21, 2018 11:15:51 PM PDT, Tom Lane wrote: >Andrei Korigodski writes: >> There is a small catch in the parsing of --help and --version args by >pgbench: >> they are processed correctly only as the first argument. > >This is, in fact, how it's done in all PG apps. Think there's a fair a

Re: pgbench: improve --help and --version parsing

2018-07-21 Thread Tom Lane
Andrei Korigodski writes: > There is a small catch in the parsing of --help and --version args by pgbench: > they are processed correctly only as the first argument. This is, in fact, how it's done in all PG apps. regards, tom lane

pgbench: improve --help and --version parsing

2018-07-21 Thread Andrei Korigodski
Hi, There is a small catch in the parsing of --help and --version args by pgbench: they are processed correctly only as the first argument. If it's not the case, strange error message occurs: $ pgbench -q --help pgbench: unrecognized option '--help' Try "pgbench --help" for more information. The