From: Michael Paquier <michael@paquier.xyz>
Date: Wed, 19 Feb 2025 00:45:59 +0000 (+0900)
Subject: test_escape: Fix handling of short options in getopt_long()
X-Git-Tag: REL_14_18~75
X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=691c32ba4b194abf590ecf58baea46349f59f109;p=postgresql.git

test_escape: Fix handling of short options in getopt_long()

This addresses two errors in the module, based on the set of options
supported:
- '-c', for --conninfo, was not listed.
- '-f', for --force-unsupported, was not listed.

While on it, these are now listed in an alphabetical order.

Author: Japin Li
Discussion: https://postgr.es/m/ME0P300MB04451FB20CE0346A59C25CADB6FA2@ME0P300MB0445.AUSP300.PROD.OUTLOOK.COM
Backpatch-through: 13
---

diff --git a/src/test/modules/test_escape/test_escape.c b/src/test/modules/test_escape/test_escape.c
index 09303a00a20..a8e9c3cb518 100644
--- a/src/test/modules/test_escape/test_escape.c
+++ b/src/test/modules/test_escape/test_escape.c
@@ -824,7 +824,7 @@ main(int argc, char *argv[])
 		{NULL, 0, NULL, 0},
 	};
 
-	while ((c = getopt_long(argc, argv, "vqh", long_options, &option_index)) != -1)
+	while ((c = getopt_long(argc, argv, "c:fhqv", long_options, &option_index)) != -1)
 	{
 		switch (c)
 		{