summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mkdir.c14
-rw-r--r--src/mknod.c14
-rw-r--r--src/mv.c16
-rw-r--r--src/rm.c16
4 files changed, 42 insertions, 18 deletions
diff --git a/src/mkdir.c b/src/mkdir.c
index e201a7ead..ba2e1eb00 100644
--- a/src/mkdir.c
+++ b/src/mkdir.c
@@ -25,9 +25,14 @@
#include "system.h"
#include "closeout.h"
#include "error.h"
-#include "long-options.h"
#include "makepath.h"
#include "modechange.h"
+#include "version-etc.h"
+
+/* The official name of this program (e.g., no `g' prefix). */
+#define PROGRAM_NAME "mkdir"
+
+#define AUTHORS "David MacKenzie"
/* The name this program was run with. */
char *program_name;
@@ -40,6 +45,8 @@ static struct option const longopts[] =
{"mode", required_argument, NULL, 'm'},
{"parents", no_argument, NULL, 'p'},
{"verbose", no_argument, NULL, 2},
+ {GETOPT_HELP_OPTION_DECL},
+ {GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
};
@@ -82,9 +89,6 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- parse_long_options (argc, argv, "mkdir", GNU_PACKAGE, VERSION,
- "David MacKenzie", usage);
-
path_mode = 0;
while ((optc = getopt_long (argc, argv, "pm:", longopts, NULL)) != -1)
@@ -102,6 +106,8 @@ main (int argc, char **argv)
case 2: /* --verbose */
verbose_fmt_string = _("created directory `%s'");
break;
+ case_GETOPT_HELP_CHAR;
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
usage (1);
}
diff --git a/src/mknod.c b/src/mknod.c
index 96bc4befd..ac5be3d0e 100644
--- a/src/mknod.c
+++ b/src/mknod.c
@@ -35,9 +35,14 @@
#include "system.h"
#include "closeout.h"
#include "error.h"
-#include "long-options.h"
#include "modechange.h"
#include "xstrtol.h"
+#include "version-etc.h"
+
+/* The official name of this program (e.g., no `g' prefix). */
+#define PROGRAM_NAME "mknod"
+
+#define AUTHORS "David MacKenzie"
/* The name this program was run with. */
char *program_name;
@@ -45,6 +50,8 @@ char *program_name;
static struct option const longopts[] =
{
{"mode", required_argument, NULL, 'm'},
+ {GETOPT_HELP_OPTION_DECL},
+ {GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
};
@@ -92,9 +99,6 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- parse_long_options (argc, argv, "mknod", GNU_PACKAGE, VERSION,
- "David MacKenzie", usage);
-
symbolic_mode = NULL;
while ((optc = getopt_long (argc, argv, "m:", longopts, NULL)) != -1)
@@ -106,6 +110,8 @@ main (int argc, char **argv)
case 'm':
symbolic_mode = optarg;
break;
+ case_GETOPT_HELP_CHAR;
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
usage (1);
}
diff --git a/src/mv.c b/src/mv.c
index b56d4d4b7..fe9c86521 100644
--- a/src/mv.c
+++ b/src/mv.c
@@ -35,7 +35,7 @@
-V, --version-control
Backup file creation.
- Written by Mike Parker and David MacKenzie */
+ Written by Mike Parker, David MacKenzie, and Jim Meyering */
#ifdef _AIX
#pragma alloca
@@ -53,9 +53,14 @@
#include "copy.h"
#include "cp-hash.h"
#include "error.h"
-#include "long-options.h"
#include "path-concat.h"
#include "remove.h"
+#include "version-etc.h"
+
+/* The official name of this program (e.g., no `g' prefix). */
+#define PROGRAM_NAME "mv"
+
+#define AUTHORS "Mike Parker, David MacKenzie, and Jim Meyering"
/* Initial number of entries in each hash table entry's table of inodes. */
#define INITIAL_HASH_MODULE 100
@@ -84,6 +89,8 @@ static struct option const long_options[] =
{"update", no_argument, NULL, 'u'},
{"verbose", no_argument, NULL, 'v'},
{"version-control", required_argument, NULL, 'V'},
+ {GETOPT_HELP_OPTION_DECL},
+ {GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
};
@@ -368,9 +375,6 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- parse_long_options (argc, argv, "mv", GNU_PACKAGE, VERSION,
- "Mike Parker, David MacKenzie, and Jim Meyering", usage);
-
cp_option_init (&x);
/* FIXME: consider not calling getenv for SIMPLE_BACKUP_SUFFIX unless
@@ -411,6 +415,8 @@ main (int argc, char **argv)
case 'V':
version = optarg;
break;
+ case_GETOPT_HELP_CHAR;
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
usage (1);
}
diff --git a/src/rm.c b/src/rm.c
index 1dbdfbbf7..2a584a6f2 100644
--- a/src/rm.c
+++ b/src/rm.c
@@ -52,9 +52,15 @@
#include "system.h"
#include "closeout.h"
#include "error.h"
-#include "long-options.h"
#include "remove.h"
#include "save-cwd.h"
+#include "version-etc.h"
+
+/* The official name of this program (e.g., no `g' prefix). */
+#define PROGRAM_NAME "rm"
+
+#define AUTHORS \
+ "Paul Rubin, David MacKenzie, Richard Stallman, and Jim Meyering"
void strip_trailing_slashes ();
@@ -68,6 +74,8 @@ static struct option const long_opts[] =
{"interactive", no_argument, NULL, 'i'},
{"recursive", no_argument, NULL, 'r'},
{"verbose", no_argument, NULL, 'v'},
+ {GETOPT_HELP_OPTION_DECL},
+ {GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
};
@@ -120,10 +128,6 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- parse_long_options (argc, argv, "rm", GNU_PACKAGE, VERSION,
- "Paul Rubin, David MacKenzie, Richard Stallman, and Jim Meyering",
- usage);
-
rm_option_init (&x);
while ((c = getopt_long (argc, argv, "dfirvR", long_opts, NULL)) != -1)
@@ -150,6 +154,8 @@ main (int argc, char **argv)
case 'v':
x.verbose = 1;
break;
+ case_GETOPT_HELP_CHAR;
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
usage (1);
}