summaryrefslogtreecommitdiff
path: root/src/shred.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/shred.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/shred.c')
-rw-r--r--src/shred.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/shred.c b/src/shred.c
index 14478c67a..67462868b 100644
--- a/src/shred.c
+++ b/src/shred.c
@@ -63,9 +63,10 @@
#include <stdarg.h> /* Used by pferror */
#include "system.h"
-#include "xstrtoul.h"
#include "closeout.h"
#include "error.h"
+#include "long-options.h"
+#include "xstrtoul.h"
#define DEFAULT_PASSES 25 /* Default */
@@ -84,12 +85,6 @@ struct Options
int zero_fill;
};
-/* 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_opts[] =
{
{"device", no_argument, NULL, 'd'},
@@ -99,8 +94,6 @@ static struct option const long_opts[] =
{"preserve", no_argument, NULL, 'p'},
{"verbose", no_argument, NULL, 'v'},
{"zero", required_argument, NULL, 'z'},
- {"help", no_argument, &show_help, 1},
- {"version", no_argument, &show_version, 1},
{NULL, 0, NULL, 0}
};
@@ -1290,6 +1283,9 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ parse_long_options (argc, argv, "shred", GNU_PACKAGE, VERSION,
+ "Colin Plumb", usage);
+
isaac_seed (&s);
memset (&flags, 0, sizeof flags);
@@ -1347,16 +1343,6 @@ main (int argc, char **argv)
}
}
- if (show_version)
- {
- printf ("shred (%s) %s\n", GNU_PACKAGE, VERSION);
- close_stdout ();
- exit (0);
- }
-
- if (show_help)
- usage (0);
-
file = argv + optind;
n_files = argc - optind;