summaryrefslogtreecommitdiff
path: root/src/touch.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-03-26 14:25:30 +0000
committerJim Meyering <jim@meyering.net>1999-03-26 14:25:30 +0000
commite7f2703c4715165015f6d815a4861647f0863def (patch)
tree9a3b6277b145366bd936d2805fab9c0e39978a61 /src/touch.c
parent3d308f9549e4ae5b8bd29b6d32ecd47ebfa45360 (diff)
downloadcoreutils-e7f2703c4715165015f6d815a4861647f0863def.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.
Diffstat (limited to 'src/touch.c')
-rw-r--r--src/touch.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/touch.c b/src/touch.c
index b8435ce91..eda5f3e8e 100644
--- a/src/touch.c
+++ b/src/touch.c
@@ -28,9 +28,15 @@
#include "closeout.h"
#include "error.h"
#include "getdate.h"
-#include "long-options.h"
#include "posixtm.h"
#include "safe-read.h"
+#include "version-etc.h"
+
+/* The official name of this program (e.g., no `g' prefix). */
+#define PROGRAM_NAME "touch"
+
+#define AUTHORS \
+ "Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith"
#ifndef STDC_HEADERS
time_t time ();
@@ -81,6 +87,8 @@ static struct option const longopts[] =
{"date", required_argument, 0, 'd'},
{"file", required_argument, 0, 'r'},
{"reference", required_argument, 0, 'r'},
+ {GETOPT_HELP_OPTION_DECL},
+ {GETOPT_VERSION_OPTION_DECL},
{0, 0, 0, 0}
};
@@ -230,10 +238,6 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- parse_long_options (argc, argv, "touch", GNU_PACKAGE, VERSION,
- "Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith",
- usage);
-
change_times = no_create = use_ref = posix_date = flexible_date = 0;
newtime = (time_t) -1;
@@ -286,6 +290,10 @@ main (int argc, char **argv)
time_args, time_masks);
break;
+ case_GETOPT_HELP_CHAR;
+
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
+
default:
usage (1);
}