From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_waldump: Fix invalid option handling
Date: Thu, 06 Jun 2019 08:28:36 +0000
Message-ID: <E1hYnlE-0003vE-H1@gemulon.postgresql.org> (raw)
pg_waldump: Fix invalid option handling
Previously, running pg_waldump with an invalid option (pg_waldump
--foo) would print the help output and exit successfully. This was
because it tried to process the option letter '?' as a normal option,
but that letter is used by getopt() to report an invalid option.
To fix, process help and version options separately, like we do
everywhere else. Also add a basic test suite for pg_waldump and run
the basic option handling tests, which would have caught this.
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f65eced25118aab29804debc4e0b9a67f4d043ad
Modified Files
--------------
src/bin/pg_waldump/.gitignore | 3 +++
src/bin/pg_waldump/Makefile | 7 +++++++
src/bin/pg_waldump/pg_waldump.c | 25 ++++++++++++++++---------
src/bin/pg_waldump/t/001_basic.pl | 8 ++++++++
4 files changed, 34 insertions(+), 9 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: peter@eisentraut.org
Subject: Re: pgsql: pg_waldump: Fix invalid option handling
In-Reply-To: <E1hYnlE-0003vE-H1@gemulon.postgresql.org>
References: <E1hYnlE-0003vE-H1@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox