From 03c1b8518c2295aebc9e723686d650162059ee96 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 31 Mar 1999 04:16:08 +0000 Subject: [PATCH] (PROGRAM_NAME, AUTHORS): Define and use. --- src/date.c | 9 +++++++-- src/env.c | 9 +++++++-- src/id.c | 9 +++++++-- src/logname.c | 9 +++++++-- src/pathchk.c | 9 +++++++-- src/pinky.c | 10 +++++++--- src/printenv.c | 9 +++++++-- src/seq.c | 9 +++++++-- src/sleep.c | 9 +++++++-- src/su.c | 9 +++++++-- src/tee.c | 10 +++++++--- src/tty.c | 9 +++++++-- src/uname.c | 9 +++++++-- src/uptime.c | 9 +++++++-- src/users.c | 9 +++++++-- src/who.c | 9 +++++++-- src/whoami.c | 9 +++++++-- 17 files changed, 119 insertions(+), 36 deletions(-) diff --git a/src/date.c b/src/date.c index bbba8fa..a61fb45 100644 --- a/src/date.c +++ b/src/date.c @@ -30,6 +30,11 @@ #include "long-options.h" #include "posixtm.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "date" + +#define AUTHORS "David MacKenzie" + #ifndef STDC_HEADERS size_t strftime (); time_t time (); @@ -280,8 +285,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "date", GNU_PACKAGE, VERSION, - "David MacKenzie", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); while ((optc = getopt_long (argc, argv, "d:f:r:Rs:u", long_options, NULL)) != -1) diff --git a/src/env.c b/src/env.c index a0d8119..dda5c11 100644 --- a/src/env.c +++ b/src/env.c @@ -87,6 +87,11 @@ #include "error.h" #include "long-options.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "env" + +#define AUTHORS "Richard Mlynarik and David MacKenzie" + int putenv (); extern char **environ; @@ -139,8 +144,8 @@ main (register int argc, register char **argv, char **envp) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "env", GNU_PACKAGE, VERSION, - "Richard Mlynarik and David MacKenzie", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); while ((optc = getopt_long (argc, argv, "+iu:", longopts, NULL)) != -1) { diff --git a/src/id.c b/src/id.c index e3a4ac4..fb982f2 100644 --- a/src/id.c +++ b/src/id.c @@ -30,6 +30,11 @@ #include "error.h" #include "long-options.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "id" + +#define AUTHORS "Arnold Robbins and David MacKenzie" + #ifndef _POSIX_VERSION struct passwd *getpwuid (); struct group *getgrgid (); @@ -119,8 +124,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "id", GNU_PACKAGE, VERSION, - "Arnold Robbins and David MacKenzie", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); while ((optc = getopt_long (argc, argv, "agnruG", longopts, NULL)) != -1) { diff --git a/src/logname.c b/src/logname.c index 913cf53..fa991a7 100644 --- a/src/logname.c +++ b/src/logname.c @@ -23,6 +23,11 @@ #include "system.h" #include "long-options.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "logname" + +#define AUTHORS "FIXME: unknown" + /* The name this program was run with. */ char *program_name; @@ -62,8 +67,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "logname", GNU_PACKAGE, VERSION, - "FIXME: unknown", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); while ((c = getopt_long (argc, argv, "", long_options, NULL)) != -1) { diff --git a/src/pathchk.c b/src/pathchk.c index ad28570..cb070a4 100644 --- a/src/pathchk.c +++ b/src/pathchk.c @@ -47,6 +47,11 @@ #include "error.h" #include "long-options.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "pathchk" + +#define AUTHORS "David MacKenzie and Jim Meyering" + #ifdef _POSIX_VERSION # ifndef PATH_MAX # define PATH_MAX_FOR(p) pathconf ((p), _PC_PATH_MAX) @@ -135,8 +140,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "pathchk", GNU_PACKAGE, VERSION, - "David MacKenzie and Jim Meyering", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); while ((optc = getopt_long (argc, argv, "p", longopts, NULL)) != -1) { diff --git a/src/pinky.c b/src/pinky.c index 31c75ea..4bf6f7e 100644 --- a/src/pinky.c +++ b/src/pinky.c @@ -27,6 +27,11 @@ #include "long-options.h" #include "readutmp.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "pinky" + +#define AUTHORS "Joseph Arceneaux, David MacKenzie, and Kaveh Ghazi" + #ifndef MAXHOSTNAMELEN # define MAXHOSTNAMELEN 64 #endif @@ -435,9 +440,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "pinky", GNU_PACKAGE, VERSION, - "Joseph Arceneaux, David MacKenzie, and Kaveh Ghazi", - usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); while ((optc = getopt_long (argc, argv, "sfwiqbhlp", longopts, &longind)) != -1) diff --git a/src/printenv.c b/src/printenv.c index 6496392..1ecfaf1 100644 --- a/src/printenv.c +++ b/src/printenv.c @@ -37,6 +37,11 @@ #include "error.h" #include "long-options.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "printenv" + +#define AUTHORS "David MacKenzie and Richard Mlynarik" + /* The name this program was run with. */ char *program_name; @@ -81,8 +86,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "printenv", GNU_PACKAGE, VERSION, - "David MacKenzie and Richard Mlynarik", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); while ((c = getopt_long (argc, argv, "", long_options, NULL)) != -1) { diff --git a/src/seq.c b/src/seq.c index 5dd9a3b..a052789 100644 --- a/src/seq.c +++ b/src/seq.c @@ -28,6 +28,11 @@ #include "long-options.h" #include "xstrtod.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "seq" + +#define AUTHORS "Ulrich Drepper" + static double scan_double_arg PARAMS ((const char *arg)); static int check_format PARAMS ((const char *format_string)); static char *get_width_format PARAMS ((void)); @@ -112,8 +117,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "seq", GNU_PACKAGE, VERSION, - "Ulrich Drepper", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); equal_width = 0; format_str = NULL; diff --git a/src/sleep.c b/src/sleep.c index 3f1ca5f..a55f301 100644 --- a/src/sleep.c +++ b/src/sleep.c @@ -24,6 +24,11 @@ #include "error.h" #include "long-options.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "sleep" + +#define AUTHORS "FIXME: unknown" + static long argdecode PARAMS ((const char *s)); /* The name by which this program was run. */ @@ -66,8 +71,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "sleep", GNU_PACKAGE, VERSION, - "FIXME: unknown", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); while ((c = getopt_long (argc, argv, "", long_options, NULL)) != -1) { diff --git a/src/su.c b/src/su.c index 3d32a57..ec18c0f 100644 --- a/src/su.c +++ b/src/su.c @@ -115,6 +115,11 @@ uid_t getuid (); #include "error.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "su" + +#define AUTHORS "David MacKenzie" + #if HAVE_PATHS_H # include #endif @@ -460,8 +465,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "su", GNU_PACKAGE, VERSION, - "David MacKenzie", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); fast_startup = 0; simulate_login = 0; diff --git a/src/tee.c b/src/tee.c index f0d3aad..e71fa61 100644 --- a/src/tee.c +++ b/src/tee.c @@ -28,6 +28,11 @@ #include "error.h" #include "long-options.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "tee" + +#define AUTHORS "Mike Parker, Richard M. Stallman, and David MacKenzie" + int full_write (); static int tee PARAMS ((int nfiles, const char **files)); @@ -81,9 +86,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "tee", GNU_PACKAGE, VERSION, - "Mike Parker, Richard M. Stallman, and David MacKenzie", - usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); append = 0; ignore_interrupts = 0; diff --git a/src/tty.c b/src/tty.c index 088a225..2e1e2ee 100644 --- a/src/tty.c +++ b/src/tty.c @@ -32,6 +32,11 @@ #include "error.h" #include "long-options.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "tty" + +#define AUTHORS "David MacKenzie" + /* The name under which this program was run. */ char *program_name; @@ -77,8 +82,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "tty", GNU_PACKAGE, VERSION, - "David MacKenzie", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); silent = 0; diff --git a/src/uname.c b/src/uname.c index f2499b8..4017dbe 100644 --- a/src/uname.c +++ b/src/uname.c @@ -42,6 +42,11 @@ #include "error.h" #include "long-options.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "uname" + +#define AUTHORS "David MacKenzie" + static void print_element PARAMS ((unsigned int mask, char *element)); /* Values that are bitwise or'd into `toprint'. */ @@ -118,8 +123,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "uname", GNU_PACKAGE, VERSION, - "David MacKenzie", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); toprint = 0; diff --git a/src/uptime.c b/src/uptime.c index 88b1945..0bf36e0 100644 --- a/src/uptime.c +++ b/src/uptime.c @@ -26,6 +26,11 @@ #include "readutmp.h" #include "system.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "uptime" + +#define AUTHORS "Joseph Arceneaux and David MacKenzie" + int getloadavg (); /* The name this program was run with. */ @@ -185,8 +190,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "uptime", GNU_PACKAGE, VERSION, - "Joseph Arceneaux and David MacKenzie", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); while ((optc = getopt_long (argc, argv, "", longopts, &longind)) != -1) { diff --git a/src/users.c b/src/users.c index 09fff71..b0df3aa 100644 --- a/src/users.c +++ b/src/users.c @@ -26,6 +26,11 @@ #include "readutmp.h" #include "system.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "users" + +#define AUTHORS "Joseph Arceneaux and David MacKenzie" + /* The name this program was run with. */ char *program_name; @@ -129,8 +134,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "users", GNU_PACKAGE, VERSION, - "Joseph Arceneaux and David MacKenzie", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); while ((optc = getopt_long (argc, argv, "", longopts, &longind)) != -1) { diff --git a/src/who.c b/src/who.c index 557fe21..88088f3 100644 --- a/src/who.c +++ b/src/who.c @@ -33,6 +33,11 @@ #include "readutmp.h" #include "system.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "who" + +#define AUTHORS "Joseph Arceneaux and David MacKenzie" + #ifndef MAXHOSTNAMELEN # define MAXHOSTNAMELEN 64 #endif @@ -383,8 +388,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "who", GNU_PACKAGE, VERSION, - "Joseph Arceneaux and David MacKenzie", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); while ((optc = getopt_long (argc, argv, "ilmqsuwHT", longopts, &longind)) != -1) diff --git a/src/whoami.c b/src/whoami.c index 3c021ab..e5fd718 100644 --- a/src/whoami.c +++ b/src/whoami.c @@ -27,6 +27,11 @@ #include "system.h" #include "long-options.h" +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "whoami" + +#define AUTHORS "Richard Mlynarik" + /* The name this program was run with. */ char *program_name; @@ -67,8 +72,8 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "whoami", GNU_PACKAGE, VERSION, - "Richard Mlynarik", usage); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + AUTHORS, usage); while ((c = getopt_long (argc, argv, "", long_options, NULL)) != -1) { -- 2.7.4