From: Collin Funk Date: Wed, 27 May 2026 02:39:29 +0000 (-0700) Subject: printenv: remove unsupported short options from getopt_long X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=255febf98b6b6b98e2871c7305d8f0ec564ba0c4;p=thirdparty%2Fcoreutils.git printenv: remove unsupported short options from getopt_long This patch only improves some error messages. Here is the behavior before the patch: $ printenv -i Try 'printenv --help' for more information. $ printenv -u printenv: option requires an argument -- 'u' Try 'printenv --help' for more information. $ printenv -u a Try 'printenv --help' for more information. Here is the behavior after: $ ./src/printenv -i ./src/printenv: invalid option -- 'i' Try './src/printenv --help' for more information. $ ./src/printenv -u ./src/printenv: invalid option -- 'u' Try './src/printenv --help' for more information. $ ./src/printenv -u a ./src/printenv: invalid option -- 'u' Try './src/printenv --help' for more information. * src/printenv.c (main): Remove 'i' and 'u' from the short options given to getopt_long. --- diff --git a/src/printenv.c b/src/printenv.c index 1f68dd2cc2..c2b1c69cda 100644 --- a/src/printenv.c +++ b/src/printenv.c @@ -93,7 +93,7 @@ main (int argc, char **argv) atexit (close_stdout); int optc; - while ((optc = getopt_long (argc, argv, "+iu:0", longopts, NULL)) != -1) + while ((optc = getopt_long (argc, argv, "+0", longopts, NULL)) != -1) { switch (optc) {