#include "match.h"
#include "c.h"
#include "closestream.h"
+#include "optutils.h"
struct wipe_desc {
loff_t offset; /* magic string offset */
int c, all = 0, has_offset = 0, noact = 0, quiet = 0;
int mode = WP_MODE_PRETTY;
+ enum {
+ EXCL_NONE,
+ EXCL_ALL,
+ EXCL_OFFSET
+ };
+ int excl_any = EXCL_NONE;
+
static const struct option longopts[] = {
{ "all", 0, 0, 'a' },
{ "help", 0, 0, 'h' },
while ((c = getopt_long(argc, argv, "ahno:pqt:V", longopts, NULL)) != -1) {
switch(c) {
case 'a':
+ exclusive_option(&excl_any, EXCL_ALL, "--{all,offset}");
all++;
break;
case 'h':
noact++;
break;
case 'o':
+ exclusive_option(&excl_any, EXCL_OFFSET, "--{all,offset}");
wp0 = add_offset(wp0, strtosize_or_err(optarg,
_("invalid offset argument")), 1);
has_offset++;
}
}
- if (wp0 && all)
- errx(EXIT_FAILURE, _("--offset and --all are mutually exclusive"));
-
if (optind == argc)
usage(stderr);