diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-26 14:26:18 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-26 14:26:18 +0000 |
commit | 695cdd6f6abb7a2a8243ce7e1ad624b16a6e0032 (patch) | |
tree | 30d372ded07a684059daf9c7001bdb6fa52270bc | |
parent | e7f2703c4715165015f6d815a4861647f0863def (diff) | |
download | coreutils-695cdd6f6abb7a2a8243ce7e1ad624b16a6e0032.tar.xz |
No longer include long-options.h.
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.
-rw-r--r-- | src/dircolors.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/dircolors.c b/src/dircolors.c index f69e931cf..bc9012465 100644 --- a/src/dircolors.c +++ b/src/dircolors.c @@ -26,13 +26,15 @@ #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); } |