]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(longopts): Add --help, --version.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 21 Sep 2004 22:12:13 +0000 (22:12 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 21 Sep 2004 22:12:13 +0000 (22:12 +0000)
(main): Use longopts rather than parse_long_options.
Don't include "long-options.h".

src/stty.c

index 7c674192651022e50b0c41d4cdec54ec2a46fc28..2aeb4dacb91073f847be69c328a2e87eb88520c8 100644 (file)
@@ -55,7 +55,6 @@
 #include <stdarg.h>
 
 #include "system.h"
-#include "long-options.h"
 #include "error.h"
 #include "xstrtol.h"
 
@@ -440,6 +439,8 @@ static struct option longopts[] =
   {"all", no_argument, NULL, 'a'},
   {"save", no_argument, NULL, 'g'},
   {"file", required_argument, NULL, 'F'},
+  {GETOPT_HELP_OPTION_DECL},
+  {GETOPT_VERSION_OPTION_DECL},
   {NULL, 0, NULL, 0}
 };
 
@@ -738,9 +739,6 @@ main (int argc, char **argv)
 
   atexit (close_stdout);
 
-  parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
-                     usage, AUTHORS, (char const *) NULL);
-
   output_type = changed;
   verbose_output = false;
   recoverable_output = false;
@@ -777,6 +775,10 @@ main (int argc, char **argv)
          file_name = optarg;
          break;
 
+       case_GETOPT_HELP_CHAR;
+
+       case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
+
        default:
          noargs = false;