diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-26 14:19:02 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-26 14:19:02 +0000 |
commit | 0aa9923d96b671490bc0a44e99c1e9cae526681e (patch) | |
tree | e41a8b4f87456e48737be73653ffe6fa13255fe6 /src | |
parent | 85b4cd220bdad64e22b4f06b09f7eae0f6e9ce6c (diff) | |
download | coreutils-0aa9923d96b671490bc0a44e99c1e9cae526681e.tar.xz |
No longer include long-options.h.
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/df.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -34,9 +34,15 @@ #include "error.h" #include "fsusage.h" #include "human.h" -#include "long-options.h" #include "mountlist.h" #include "save-cwd.h" +#include "version-etc.h" + +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "df" + +#define AUTHORS \ + "Torbjorn Granlund, David MacKenzie, Larry McVoy, and Paul Eggert" void strip_trailing_slashes (); char *xstrdup (); @@ -123,6 +129,8 @@ static struct option const long_options[] = {"no-sync", no_argument, NULL, CHAR_MAX + 2}, {"type", required_argument, NULL, 't'}, {"exclude-type", required_argument, NULL, 'x'}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, {NULL, 0, NULL, 0} }; @@ -615,10 +623,6 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "df", GNU_PACKAGE, VERSION, - "Torbjorn Granlund, David MacKenzie, Larry McVoy, and Paul Eggert", - usage); - fs_select_list = NULL; fs_exclude_list = NULL; inode_format = 0; @@ -688,6 +692,10 @@ main (int argc, char **argv) case 'x': add_excluded_fs_type (optarg); break; + + case_GETOPT_HELP_CHAR; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + default: usage (1); } |