diff options
author | Md Islam <[email protected]> | 2018-10-30 12:47:50 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-10-30 11:47:50 -0500 |
commit | 9042f6033a72e2ffbd4f92af7de83ad0f81f1dfc (patch) | |
tree | 378db70f53004722546bbc0bd74ff594d8139e0d | |
parent | 0a544c174d54d9adcea2faf5817596174582139e (diff) |
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Md Islam <[email protected]>
Closes #8047
-rw-r--r-- | lib/libzfs/libzfs_dataset.c | 6 |
1 files changed, 4 insertions, 2 deletions
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); } |