summaryrefslogtreecommitdiff
path: root/src/logname.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-03-06 15:28:54 +0000
committerJim Meyering <jim@meyering.net>1999-03-06 15:28:54 +0000
commit5b2aa1846bc8dc6d8ffce7d523cebc1ab45a17d7 (patch)
tree84329e3e3519feb76d3835f81928c4b657c495cf /src/logname.c
parent782b27031417465b6d79e2d0d8c608b8ea842ce9 (diff)
downloadcoreutils-5b2aa1846bc8dc6d8ffce7d523cebc1ab45a17d7.tar.xz
Include long-options.h.
[long_options]: Remove the "help" and "version" entries. Remove declarations of show_help and show_version. (main): Use parse_long_options, including author name(s). Remove the show_version and show_help blocks.
Diffstat (limited to 'src/logname.c')
-rw-r--r--src/logname.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/logname.c b/src/logname.c
index b9b3f60fa..913cf53d2 100644
--- a/src/logname.c
+++ b/src/logname.c
@@ -21,20 +21,13 @@
#include <getopt.h>
#include "system.h"
+#include "long-options.h"
/* The name this program was run with. */
char *program_name;
-/* If nonzero, display usage information and exit. */
-static int show_help;
-
-/* If nonzero, print the version on standard output and exit. */
-static int show_version;
-
static struct option const long_options[] =
{
- {"help", no_argument, &show_help, 1},
- {"version", no_argument, &show_version, 1},
{0, 0, 0, 0}
};
@@ -69,6 +62,9 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ parse_long_options (argc, argv, "logname", GNU_PACKAGE, VERSION,
+ "FIXME: unknown", usage);
+
while ((c = getopt_long (argc, argv, "", long_options, NULL)) != -1)
{
switch (c)
@@ -81,15 +77,6 @@ main (int argc, char **argv)
}
}
- if (show_version)
- {
- printf ("logname (%s) %s\n", GNU_PACKAGE, VERSION);
- exit (0);
- }
-
- if (show_help)
- usage (0);
-
if (argc - optind != 0)
usage (1);