]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: getlimits: diagnose invalid options
authorPádraig Brady <P@draigBrady.com>
Tue, 27 Sep 2022 17:27:05 +0000 (18:27 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 28 Sep 2022 14:06:11 +0000 (15:06 +0100)
* src/getlimits.c: Don't call initialize_exit_failure()
as it's not needed for standard EXIT_FAILURE returns.
Also use the function variant that diagnoses invalid options.

src/getlimits.c

index 7b7fa58aa073f8498d256dd9a6377ff33e1734d5..e689f8c1e3563418070b27f4fb9b22e0e7f835e0 100644 (file)
@@ -123,11 +123,10 @@ main (int argc, char **argv)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
-  initialize_exit_failure (EXIT_FAILURE);
   atexit (close_stdout);
 
-  parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, VERSION,
-                      usage, AUTHORS, (char const *) NULL);
+  parse_gnu_standard_options_only (argc, argv, PROGRAM_NAME, PACKAGE_NAME,
+                                   VERSION, true, usage, AUTHORS, NULL);
 
 #define print_int(TYPE)                                                  \
   sprintf (limit + 1, "%"PRIuMAX, (uintmax_t) TYPE##_MAX);               \