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.
#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;
{"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}
};
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)
case 2: /* --verbose */
verbose_fmt_string = _("created directory `%s'");
break;
+ case_GETOPT_HELP_CHAR;
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
usage (1);
}
#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;
static struct option const longopts[] =
{
{"mode", required_argument, NULL, 'm'},
+ {GETOPT_HELP_OPTION_DECL},
+ {GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
};
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)
case 'm':
symbolic_mode = optarg;
break;
+ case_GETOPT_HELP_CHAR;
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
usage (1);
}
-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
#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
{"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}
};
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
case 'V':
version = optarg;
break;
+ case_GETOPT_HELP_CHAR;
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
usage (1);
}
#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 ();
{"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}
};
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)
case 'v':
x.verbose = 1;
break;
+ case_GETOPT_HELP_CHAR;
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
usage (1);
}