diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-04 05:09:05 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-04 05:09:05 +0000 |
commit | 61fa70ac19d9202f6509e97e4bda1f4ab8f5d1fd (patch) | |
tree | 1fb89b9b511548ea40a899b6c60f1371cf6123f4 /src/mknod.c | |
parent | d0bdbe00ba72224915a61589a399bc0e86d74d80 (diff) | |
download | coreutils-61fa70ac19d9202f6509e97e4bda1f4ab8f5d1fd.tar.xz |
Include long-options.h
[long_options]: Remove the "help" and "version" entries.
(main): Use parse_long_options, including author name(s).
Remove the show_version and show_help blocks.
Diffstat (limited to 'src/mknod.c')
-rw-r--r-- | src/mknod.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/mknod.c b/src/mknod.c index a813b9f7e..96bc4befd 100644 --- a/src/mknod.c +++ b/src/mknod.c @@ -33,25 +33,18 @@ #include <sys/types.h> #include "system.h" -#include "modechange.h" #include "closeout.h" #include "error.h" +#include "long-options.h" +#include "modechange.h" #include "xstrtol.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 longopts[] = { {"mode", required_argument, NULL, 'm'}, - {"help", no_argument, &show_help, 1}, - {"version", no_argument, &show_version, 1}, {NULL, 0, NULL, 0} }; @@ -99,6 +92,9 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + parse_long_options (argc, argv, "mknod", GNU_PACKAGE, VERSION, + "David MacKenzie", usage); + symbolic_mode = NULL; while ((optc = getopt_long (argc, argv, "m:", longopts, NULL)) != -1) @@ -115,16 +111,6 @@ main (int argc, char **argv) } } - if (show_version) - { - printf ("mknod (%s) %s\n", GNU_PACKAGE, VERSION); - close_stdout (); - exit (0); - } - - if (show_help) - usage (0); - newmode = 0666 & ~umask (0); if (symbolic_mode) { |