diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-06 15:28:54 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-06 15:28:54 +0000 |
commit | 5b2aa1846bc8dc6d8ffce7d523cebc1ab45a17d7 (patch) | |
tree | 84329e3e3519feb76d3835f81928c4b657c495cf /src/pathchk.c | |
parent | 782b27031417465b6d79e2d0d8c608b8ea842ce9 (diff) | |
download | coreutils-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/pathchk.c')
-rw-r--r-- | src/pathchk.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/pathchk.c b/src/pathchk.c index 2fc24dd69..ad285706a 100644 --- a/src/pathchk.c +++ b/src/pathchk.c @@ -45,6 +45,7 @@ #include "system.h" #include "error.h" +#include "long-options.h" #ifdef _POSIX_VERSION # ifndef PATH_MAX @@ -96,17 +97,8 @@ static int validate_path PARAMS ((char *path, int portability)); /* 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 longopts[] = { - {"help", no_argument, &show_help, 1}, - {"portability", no_argument, NULL, 'p'}, - {"version", no_argument, &show_version, 1}, {NULL, 0, NULL, 0} }; @@ -143,6 +135,9 @@ 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); + while ((optc = getopt_long (argc, argv, "p", longopts, NULL)) != -1) { switch (optc) @@ -159,15 +154,6 @@ main (int argc, char **argv) } } - if (show_version) - { - printf ("pathchk (%s) %s\n", GNU_PACKAGE, VERSION); - exit (0); - } - - if (show_help) - usage (0); - if (optind == argc) { error (0, 0, _("too few arguments")); |