]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
No longer include long-options.h.
authorJim Meyering <jim@meyering.net>
Fri, 26 Mar 1999 14:26:18 +0000 (14:26 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 26 Mar 1999 14:26:18 +0000 (14:26 +0000)
Include version-etc.h instead.
(PROGRAM_NAME, AUTHORS): Define.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.

src/dircolors.c

index f69e931cf3c970801eb0aebc5f88db68b874ec2f..bc9012465b1ab526686f6f0eeba474f146fecbe3 100644 (file)
 #include <stdio.h>
 
 #include "system.h"
-#include "getline.h"
-#include "long-options.h"
 #include "closeout.h"
+#include "dircolors.h"
 #include "error.h"
-#include "long-options.h"
+#include "getline.h"
 #include "obstack.h"
-#include "dircolors.h"
+#include "version-etc.h"
+
+/* The official name of this program (e.g., no `g' prefix).  */
+#define PROGRAM_NAME "dircolors"
 
 #define obstack_chunk_alloc malloc
 #define obstack_chunk_free free
@@ -84,6 +86,8 @@ static struct option const long_options[] =
     {"csh", no_argument, NULL, 'c'},
     {"c-shell", no_argument, NULL, 'c'},
     {"print-database", no_argument, NULL, 'p'},
+    {GETOPT_HELP_OPTION_DECL},
+    {GETOPT_VERSION_OPTION_DECL},
     {NULL, 0, NULL, 0}
   };
 
@@ -427,9 +431,6 @@ main (int argc, char **argv)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
-  parse_long_options (argc, argv, "dircolors", GNU_PACKAGE, VERSION,
-                     "H. Peter Anvin", usage);
-
   while ((optc = getopt_long (argc, argv, "bcp", long_options, NULL)) != -1)
     switch (optc)
       {
@@ -445,6 +446,10 @@ main (int argc, char **argv)
        print_database = 1;
        break;
 
+      case_GETOPT_HELP_CHAR;
+
+      case_GETOPT_VERSION_CHAR (PROGRAM_NAME, "H. Peter Anvin");
+
       default:
        usage (1);
       }