From: Md Islam Date: Tue, 30 Oct 2018 16:47:50 +0000 (-0400) Subject: Improve snapshot listing error message X-Git-Tag: zfs-0.8.0-rc2~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9042f6033a72e2ffbd4f92af7de83ad0f81f1dfc;p=zfs Improve snapshot listing error message Provide a hint in the error message if listing snapshots for a single dataset fails. Using -r is not needed to list all snapshots so requiring it when listing snapshots for a single dataset makes it confusing. This change will make the error message more clear. Reviewed-by: Matthew Ahrens Reviewed-by: Brian Behlendorf Signed-off-by: Md Islam Closes #8047 --- diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index 5767b2ee3..c84ed5bda 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -178,7 +178,8 @@ zfs_validate_name(libzfs_handle_t *hdl, const char *path, int type, if (type == ZFS_TYPE_SNAPSHOT && strchr(path, '@') == NULL) { if (hdl != NULL) zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "missing '@' delimiter in snapshot name")); + "missing '@' delimiter in snapshot name, " + "did you mean to use -r?")); return (0); } @@ -192,7 +193,8 @@ zfs_validate_name(libzfs_handle_t *hdl, const char *path, int type, if (type == ZFS_TYPE_BOOKMARK && strchr(path, '#') == NULL) { if (hdl != NULL) zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "missing '#' delimiter in bookmark name")); + "missing '#' delimiter in bookmark name, " + "did you mean to use -r?")); return (0); }