diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-26 14:22:51 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-26 14:22:51 +0000 |
commit | f42367c3e7f266dce685aed7a6629d13ba5a324c (patch) | |
tree | d3afe8acc5effc50e33eee1d571e763180f219cf /src/du.c | |
parent | 0aa9923d96b671490bc0a44e99c1e9cae526681e (diff) | |
download | coreutils-f42367c3e7f266dce685aed7a6629d13ba5a324c.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/du.c')
-rw-r--r-- | src/du.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -56,11 +56,17 @@ #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 @@ -189,6 +195,8 @@ static struct option const long_options[] = {"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} }; @@ -251,10 +259,6 @@ main (int argc, char **argv) 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; @@ -343,6 +347,10 @@ main (int argc, char **argv) human_block_size (optarg, 1, &output_block_size); break; + case_GETOPT_HELP_CHAR; + + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + default: usage (1); } |