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 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

pgbench: improve --help and --version parsing

2018-07-21 Thread Andrei Korigodski
"--version") == 0 || strcmp(argv[1], "-V") == 0)     {         puts("pgbench (PostgreSQL) " PG_VERSION);         exit(0);     } } All other arguments are processed with getopt_long. The proposed patch replaces the existing way of parsing the --help and --version a