From: Collin Funk Date: Mon, 12 Jan 2026 04:43:37 +0000 (-0800) Subject: maint: ptx: place long options without short options after CHAR_MAX X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87898a6a94d8e17fb40a38e61072fc3e14d23d26;p=thirdparty%2Fcoreutils.git maint: ptx: place long options without short options after CHAR_MAX * src/ptx.c (FORMAT_OPTION): New constant. (long_options): Use FORMAT_OPTION instead of 10. (main): Likewise. --- diff --git a/src/ptx.c b/src/ptx.c index 2d548530d9..20f61afa39 100644 --- a/src/ptx.c +++ b/src/ptx.c @@ -1721,6 +1721,13 @@ Output a permuted index, including context, of the words in the input files.\n\ | strings, then launch execution. | `----------------------------------------------------------------------*/ +/* For long options that have no equivalent short option, use a + non-character as a pseudo short option, starting with CHAR_MAX + 1. */ +enum +{ + FORMAT_OPTION = CHAR_MAX + 1 +}; + /* Long options equivalences. */ static struct option const long_options[] = { @@ -1734,7 +1741,7 @@ static struct option const long_options[] = {"only-file", required_argument, nullptr, 'o'}, {"references", no_argument, nullptr, 'r'}, {"right-side-refs", no_argument, nullptr, 'R'}, - {"format", required_argument, nullptr, 10}, + {"format", required_argument, nullptr, FORMAT_OPTION}, {"sentence-regexp", required_argument, nullptr, 'S'}, {"traditional", no_argument, nullptr, 'G'}, {"typeset-mode", no_argument, nullptr, 't'}, @@ -1868,7 +1875,7 @@ main (int argc, char **argv) word_regex.string = nullptr; break; - case 10: + case FORMAT_OPTION: output_format = XARGMATCH ("--format", optarg, format_args, format_vals); break;