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 "error.h"
#include "exclude.h"
#include "human.h"
-#include "long-options.h"
#include "save-cwd.h"
#include "savedir.h"
+#include "version-etc.h"
#include "xstrtol.h"
+/* The official name of this program (e.g., no `g' prefix). */
+#define PROGRAM_NAME "du"
+
+#define AUTHORS \
+ "Torbjorn Granlund, David MacKenzie, Larry McVoy, and Paul Eggert"
+
/* Initial number of entries in each hash table entry's table of inodes. */
#define INITIAL_HASH_MODULE 100
{"separate-dirs", no_argument, NULL, 'S'},
{"summarize", no_argument, NULL, 's'},
{"total", no_argument, NULL, 'c'},
+ {GETOPT_HELP_OPTION_DECL},
+ {GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
};
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- parse_long_options (argc, argv, "du", GNU_PACKAGE, VERSION,
- "Torbjorn Granlund, David MacKenzie, Larry McVoy, and Paul Eggert",
- usage);
-
exclude = new_exclude ();
xstat = lstat;
human_block_size (optarg, 1, &output_block_size);
break;
+ case_GETOPT_HELP_CHAR;
+
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
+
default:
usage (1);
}
#include "cp-hash.h"
#include "copy.h"
#include "dirname.h"
-#include "long-options.h"
#include "makepath.h"
#include "modechange.h"
#include "path-concat.h"
+#include "version-etc.h"
#include "xstrtol.h"
+/* The official name of this program (e.g., no `g' prefix). */
+#define PROGRAM_NAME "install"
+
+#define AUTHORS "David MacKenzie"
+
#if HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif
{"suffix", required_argument, NULL, 'S'},
{"version-control", required_argument, NULL, 'V'},
{"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, "install", GNU_PACKAGE, VERSION,
- "David MacKenzie", usage);
-
cp_option_init (&x);
owner_name = NULL;
case 'V':
version = optarg;
break;
+ case_GETOPT_HELP_CHAR;
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
usage (1);
}
#include "closeout.h"
#include "dirname.h"
#include "error.h"
-#include "long-options.h"
+#include "version-etc.h"
+
+/* The official name of this program (e.g., no `g' prefix). */
+#define PROGRAM_NAME "ln"
+
+#define AUTHORS "Mike Parker and David MacKenzie"
int link (); /* Some systems don't declare this anywhere. */
{"symbolic", no_argument, NULL, 's'},
{"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, "ln", GNU_PACKAGE, VERSION,
- "Mike Parker and David MacKenzie", usage);
-
/* FIXME: consider not calling getenv for SIMPLE_BACKUP_SUFFIX unless
we'll actually use simple_backup_suffix. */
version = getenv ("SIMPLE_BACKUP_SUFFIX");
case 'V':
version = optarg;
break;
+ case_GETOPT_HELP_CHAR;
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
usage (1);
break;
#include "system.h"
#include "closeout.h"
#include "error.h"
-#include "long-options.h"
#include "modechange.h"
+#include "version-etc.h"
+
+/* The official name of this program (e.g., no `g' prefix). */
+#define PROGRAM_NAME "mkfifo"
+
+#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, "mkfifo", GNU_PACKAGE, VERSION,
- "David MacKenzie", usage);
-
symbolic_mode = NULL;
#ifndef S_ISFIFO
case 'm':
symbolic_mode = optarg;
break;
+ case_GETOPT_HELP_CHAR;
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
usage (1);
}