postgresql/src/bin
Nathan Bossart 411b720343 Teach in-tree getopt_long() to move non-options to the end of argv.
Unlike the other implementations of getopt_long() I could find, the
in-tree implementation does not reorder non-options to the end of
argv.  Instead, it returns -1 as soon as the first non-option is
found, even if there are other options listed afterwards.  By
moving non-options to the end of argv, getopt_long() can parse all
specified options and return -1 when only non-options remain.
This quirk is periodically missed by hackers (e.g., 869aa40a27,
ffd398021c, and d9ddc50baf).  This commit introduces the
aforementioned non-option reordering behavior to the in-tree
getopt_long() implementation.

Special thanks to Noah Misch for his help verifying behavior on
AIX.

Reviewed-by: Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/20230609232257.GA121461%40nathanxps13
2023-07-12 20:34:39 -07:00
..
initdb Clean up command argument assembly 2023-07-05 07:15:23 +02:00
pg_amcheck Translation updates 2023-05-22 12:44:31 +02:00
pg_archivecleanup Introduce long options in pg_archivecleanup 2023-06-30 15:47:11 +09:00
pg_basebackup Fix tmpdir issues with commit e213de8e78 2023-07-08 12:34:25 -04:00
pg_checksums Translation updates 2023-05-22 12:44:31 +02:00
pg_config Translation updates 2023-05-22 12:44:31 +02:00
pg_controldata Translation updates 2023-05-22 12:44:31 +02:00
pg_ctl Translation updates 2023-05-22 12:44:31 +02:00
pg_dump Revert MAINTAIN privilege and pg_maintain predefined role. 2023-07-07 11:25:13 -07:00
pg_resetwal Translation updates 2023-05-22 12:44:31 +02:00
pg_rewind Translation updates 2023-05-22 12:44:31 +02:00
pg_test_fsync Translation updates 2023-05-22 12:44:31 +02:00
pg_test_timing Translation updates 2023-05-22 12:44:31 +02:00
pg_upgrade Translation updates 2023-05-22 12:44:31 +02:00
pg_verifybackup Translation updates 2023-05-22 12:44:31 +02:00
pg_waldump pg_waldump: Add test case for notice message 2023-07-05 10:50:16 +02:00
pgbench Remove --disable-thread-safety and related code. 2023-07-12 08:20:43 +12:00
pgevent Update copyright for 2023 2023-01-02 15:00:37 -05:00
psql Rename port/thread.c to port/user.c. 2023-07-09 18:17:09 +12:00
scripts Teach in-tree getopt_long() to move non-options to the end of argv. 2023-07-12 20:34:39 -07:00
Makefile Update copyright for 2023 2023-01-02 15:00:37 -05:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00