]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Improve snapshot listing error message
authorMd Islam <mdnahian@outlook.com>
Tue, 30 Oct 2018 16:47:50 +0000 (12:47 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 30 Oct 2018 16:47:50 +0000 (11:47 -0500)
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 <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Md Islam <mdnahian@outlook.com>
Closes #8047

lib/libzfs/libzfs_dataset.c

index 5767b2ee388ef3b37a14c3a84d17e61e19657473..c84ed5bdabcb31951dc9d043295404ba387144af 100644 (file)
@@ -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);
        }