summaryrefslogtreecommitdiff
path: root/src/dd.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-03-04 05:09:05 +0000
committerJim Meyering <jim@meyering.net>1999-03-04 05:09:05 +0000
commit61fa70ac19d9202f6509e97e4bda1f4ab8f5d1fd (patch)
tree1fb89b9b511548ea40a899b6c60f1371cf6123f4 /src/dd.c
parentd0bdbe00ba72224915a61589a399bc0e86d74d80 (diff)
downloadcoreutils-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/dd.c')
-rw-r--r--src/dd.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/dd.c b/src/dd.c
index 9f21bb9fa..f63688f3a 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -29,10 +29,11 @@
#include <signal.h>
#include <getopt.h>
-#include "human.h"
#include "system.h"
#include "closeout.h"
#include "error.h"
+#include "human.h"
+#include "long-options.h"
#include "safe-read.h"
#ifndef SIGINFO
@@ -266,16 +267,8 @@ static unsigned char const ebcdic_to_ascii[] =
070, 071, 0372, 0373, 0374, 0375, 0376, 0377
};
-/* 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 long_options[] =
{
- {"help", no_argument, &show_help, 1},
- {"version", no_argument, &show_version, 1},
{0, 0, 0, 0}
};
@@ -1111,6 +1104,9 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ parse_long_options (argc, argv, "dd", GNU_PACKAGE, VERSION,
+ "Paul Rubin, David MacKenzie, and Stuart Kemp", usage);
+
/* Initialize translation table to identity translation. */
for (i = 0; i < 256; i++)
trans_table[i] = i;
@@ -1118,16 +1114,6 @@ main (int argc, char **argv)
/* Decode arguments. */
scanargs (argc, argv);
- if (show_version)
- {
- printf ("dd (%s) %s\n", GNU_PACKAGE, VERSION);
- close_stdout ();
- exit (0);
- }
-
- if (show_help)
- usage (0);
-
apply_translations ();
if (input_file != NULL)