From 9042f6033a72e2ffbd4f92af7de83ad0f81f1dfc Mon Sep 17 00:00:00 2001 From: Md Islam Date: Tue, 30 Oct 2018 12:47:50 -0400 Subject: 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 --- lib/libzfs/libzfs_dataset.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/libzfs/libzfs_dataset.c') 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); } -- cgit v1.2.3