mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
cmd/zfs: redact: better error message for common usage errors
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Matt Ahrens <matt@delphix.com> Signed-off-by: Christian Schwarz <me@cschwarz.com> Closes #9867
This commit is contained in:
committed by
Brian Behlendorf
parent
7b53e2e5a9
commit
f658f61c72
+11
-2
@@ -3746,8 +3746,13 @@ zfs_do_redact(int argc, char **argv)
|
||||
"specified\n"));
|
||||
break;
|
||||
case EINVAL:
|
||||
(void) fprintf(stderr, gettext("redaction snapshot must be "
|
||||
"descendent of snapshot being redacted\n"));
|
||||
if (strchr(bookname, '#') != NULL)
|
||||
(void) fprintf(stderr, gettext(
|
||||
"redaction bookmark name must not contain '#'\n"));
|
||||
else
|
||||
(void) fprintf(stderr, gettext(
|
||||
"redaction snapshot must be descendent of "
|
||||
"snapshot being redacted\n"));
|
||||
break;
|
||||
case EALREADY:
|
||||
(void) fprintf(stderr, gettext("attempted to redact redacted "
|
||||
@@ -3757,6 +3762,10 @@ zfs_do_redact(int argc, char **argv)
|
||||
(void) fprintf(stderr, gettext("redaction bookmarks feature "
|
||||
"not enabled\n"));
|
||||
break;
|
||||
case EXDEV:
|
||||
(void) fprintf(stderr, gettext("potentially invalid redaction "
|
||||
"snapshot; full dataset names required\n"));
|
||||
break;
|
||||
default:
|
||||
(void) fprintf(stderr, gettext("internal error: %s\n"),
|
||||
strerror(errno));
|
||||
|
||||
Reference in New Issue
Block a user