summaryrefslogtreecommitdiff
path: root/src/chmod.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-03-26 04:11:15 +0000
committerJim Meyering <jim@meyering.net>1999-03-26 04:11:15 +0000
commit06303195c077e428eddcd4a7ebc43572d2a5fb6b (patch)
tree567286875e4004949a08c6599105c5e55e4ac96f /src/chmod.c
parentdd007634ac63e0b81472aeeee8706a1c68a35b98 (diff)
downloadcoreutils-06303195c077e428eddcd4a7ebc43572d2a5fb6b.tar.xz
No longer include long-options.h.
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.
Diffstat (limited to 'src/chmod.c')
-rw-r--r--src/chmod.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/chmod.c b/src/chmod.c
index 748ee2189..40597b7d1 100644
--- a/src/chmod.c
+++ b/src/chmod.c
@@ -26,9 +26,12 @@
#include "closeout.h"
#include "error.h"
#include "filemode.h"
-#include "long-options.h"
#include "modechange.h"
#include "savedir.h"
+#include "version-etc.h"
+
+/* The official name of this program (e.g., no `g' prefix). */
+#define PROGRAM_NAME "chmod"
enum Change_status
{
@@ -79,6 +82,8 @@ static struct option const long_options[] =
{"quiet", 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}
};
@@ -273,9 +278,6 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- parse_long_options (argc, argv, "chmod", GNU_PACKAGE, VERSION,
- "David MacKenzie", usage);
-
recurse = force_silent = 0;
while (1)
@@ -323,6 +325,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);
}