MFC two minor fixes:

* Message when exiting with a deferred error code.
  * Don't crash on bad use of -W
This commit is contained in:
kientzle 2007-08-07 05:34:38 +00:00
parent 9a81c1a075
commit 0ec9eae153

View File

@ -641,6 +641,9 @@ main(int argc, char **argv)
}
cleanup_exclusions(bsdtar);
if (bsdtar->return_value != 0)
bsdtar_warnc(bsdtar, 0,
"Error exit delayed from previous errors.");
return (bsdtar->return_value);
}
@ -886,6 +889,10 @@ bsdtar_getopt(struct bsdtar *bsdtar, const char *optstring,
"(matches both %s and %s)",
p, (*poption)->name, option->name);
if ((*poption)->has_arg == required_argument
&& optarg == NULL)
bsdtar_errc(bsdtar, 1, 0,
"Option \"%s\" requires argument", p);
} else {
opt = '?';
/* TODO: Set up a fake 'struct option' for