diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-26 14:23:59 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-26 14:23:59 +0000 |
commit | 3d308f9549e4ae5b8bd29b6d32ecd47ebfa45360 (patch) | |
tree | 8d72275677ff9d4e80679133cf5428adece121fc /src/mkdir.c | |
parent | f42367c3e7f266dce685aed7a6629d13ba5a324c (diff) | |
download | coreutils-3d308f9549e4ae5b8bd29b6d32ecd47ebfa45360.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/mkdir.c')
-rw-r--r-- | src/mkdir.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mkdir.c b/src/mkdir.c index e201a7ead..ba2e1eb00 100644 --- a/src/mkdir.c +++ b/src/mkdir.c @@ -25,9 +25,14 @@ #include "system.h" #include "closeout.h" #include "error.h" -#include "long-options.h" #include "makepath.h" #include "modechange.h" +#include "version-etc.h" + +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "mkdir" + +#define AUTHORS "David MacKenzie" /* The name this program was run with. */ char *program_name; @@ -40,6 +45,8 @@ static struct option const longopts[] = {"mode", required_argument, NULL, 'm'}, {"parents", no_argument, NULL, 'p'}, {"verbose", no_argument, NULL, 2}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, {NULL, 0, NULL, 0} }; @@ -82,9 +89,6 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "mkdir", GNU_PACKAGE, VERSION, - "David MacKenzie", usage); - path_mode = 0; while ((optc = getopt_long (argc, argv, "pm:", longopts, NULL)) != -1) @@ -102,6 +106,8 @@ main (int argc, char **argv) case 2: /* --verbose */ verbose_fmt_string = _("created directory `%s'"); break; + case_GETOPT_HELP_CHAR; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); default: usage (1); } |