Обсуждение: pgsql: Use Getopt::Long for catalog scripts
Use Getopt::Long for catalog scripts Replace hand-rolled option parsing with the Getopt module. This is shorter and easier to read. In passing, make some cosmetic adjustments for consistency. Author: John Naylor Reviewed-by: David Fetter Discussion: https://postgr.es/m/CACPNZCvRjepXh5b2N50njN+rO_2Nzcf=jhMkKX7=79XWUKJyKA@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/fe33a196ded8565d0fd8367e816d695b840e40cb Modified Files -------------- src/backend/catalog/Makefile | 8 ++----- src/backend/catalog/genbki.pl | 49 ++++++++++++---------------------------- src/backend/utils/Gen_fmgrtab.pl | 38 ++++++++++--------------------- src/backend/utils/Makefile | 2 +- 4 files changed, 29 insertions(+), 68 deletions(-)
On Wed, Feb 13, 2019 at 2:26 AM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote: > > Use Getopt::Long for catalog scripts > > Replace hand-rolled option parsing with the Getopt module. This is > shorter and easier to read. In passing, make some cosmetic adjustments > for consistency. > > Author: John Naylor > Reviewed-by: David Fetter > Discussion: https://postgr.es/m/CACPNZCvRjepXh5b2N50njN+rO_2Nzcf=jhMkKX7=79XWUKJyKA@mail.gmail.com > > Branch > ------ > master > > Details > ------- > https://git.postgresql.org/pg/commitdiff/fe33a196ded8565d0fd8367e816d695b840e40cb > > Modified Files > -------------- > src/backend/catalog/Makefile | 8 ++----- > src/backend/catalog/genbki.pl | 49 ++++++++++++---------------------------- > src/backend/utils/Gen_fmgrtab.pl | 38 ++++++++++--------------------- > src/backend/utils/Makefile | 2 +- > 4 files changed, 29 insertions(+), 68 deletions(-) Hi, whelk, woodlouse and dory say: Generating src/interfaces/ecpg/pgtypeslib/pgtypeslib.def... Unknown option: i../../../src/include/ Usage: perl -I [directory of Catalog.pm] Gen_fmgrtab.pl [--include-path/-i <path>] [path to pg_proc.dat] Options: --output Output directory (default '.') --include-path Include path in source tree Does Solution.pm need to be tweaked? -- Thomas Munro http://www.enterprisedb.com
On 2019-Feb-13, Thomas Munro wrote: > whelk, woodlouse and dory say: > > Generating src/interfaces/ecpg/pgtypeslib/pgtypeslib.def... > Unknown option: i../../../src/include/ > Usage: perl -I [directory of Catalog.pm] Gen_fmgrtab.pl > [--include-path/-i <path>] [path to pg_proc.dat] > > Options: > --output Output directory (default '.') > --include-path Include path in source tree > > Does Solution.pm need to be tweaked? So Getopt::Long does not like the missing ' ' or '=', eh? I pushed an untested fix, let's see if that's it. Thanks for the poke. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services