]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
No longer include long-options.h.
authorJim Meyering <jim@meyering.net>
Fri, 26 Mar 1999 04:10:55 +0000 (04:10 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 26 Mar 1999 04:10:55 +0000 (04:10 +0000)
Include version-etc.h instead.
(PROGRAM_NAME): 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/chown.c

index 49e6f932cf0a4b94d39607a7463fb1d6662074a9..0904de6c3959b02416f3288027acef422ac3da26 100644 (file)
 #include "system.h"
 #include "closeout.h"
 #include "error.h"
-#include "long-options.h"
 #include "lchown.h"
 #include "savedir.h"
+#include "version-etc.h"
+
+/* The official name of this program (e.g., no `g' prefix).  */
+#define PROGRAM_NAME "chown"
 
 #ifndef _POSIX_VERSION
 struct passwd *getpwnam ();
@@ -114,6 +117,8 @@ static struct option const long_options[] =
   {"silent", no_argument, 0, 'f'},
   {"reference", required_argument, 0, CHAR_MAX + 1},
   {"verbose", no_argument, 0, 'v'},
+  {GETOPT_HELP_OPTION_DECL},
+  {GETOPT_VERSION_OPTION_DECL},
   {0, 0, 0, 0}
 };
 
@@ -326,9 +331,6 @@ main (int argc, char **argv)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
-  parse_long_options (argc, argv, "chown", GNU_PACKAGE, VERSION,
-                     "David MacKenzie", usage);
-
   recurse = force_silent = 0;
 
   while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, NULL)) != -1)
@@ -358,6 +360,8 @@ main (int argc, char **argv)
        case 'v':
          verbosity = V_high;
          break;
+       case_GETOPT_HELP_CHAR;
+       case_GETOPT_VERSION_CHAR (PROGRAM_NAME, "David MacKenzie");
        default:
          usage (1);
        }