pg_waldump: Fix invalid option handling
Peter Eisentraut <peter@eisentraut.org>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/pg_waldump/.gitignore | modified | +3 −0 |
| src/bin/pg_waldump/Makefile | modified | +7 −0 |
| src/bin/pg_waldump/pg_waldump.c | modified | +16 −9 |
| src/bin/pg_waldump/t/001_basic.pl | added | +8 −0 |