summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c11
-rw-r--r--cli/src/cli-rpc-ops.c12
2 files changed, 21 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 15675c8..8e914fa 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -3468,6 +3468,13 @@ cli_cmd_snapshot_parse (const char **words, int wordcount, dict_t **options,
* parsing fails & snapname cannot be "description",
* "force" and "volume", that check is made here
*/
+ if (wordcount == 2){
+ ret = -1;
+ gf_log ("cli", GF_LOG_ERROR,
+ "Invalid Syntax");
+ goto out;
+ }
+
ret = validate_snapname (words[2], invalid_snapnames);
if (ret) {
goto out;
@@ -3476,7 +3483,7 @@ cli_cmd_snapshot_parse (const char **words, int wordcount, dict_t **options,
ret = cli_snap_create_parse (dict, words,
wordcount, cmdi);
if (ret) {
- gf_log ("", GF_LOG_ERROR,
+ gf_log ("cli", GF_LOG_ERROR,
"create command parsing failed.");
goto out;
}
@@ -3485,7 +3492,7 @@ cli_cmd_snapshot_parse (const char **words, int wordcount, dict_t **options,
case GF_SNAP_OPTION_TYPE_INFO:
{
/* Syntax :
- * gluster snapshot info ([snapname] | [vol <volname>])
+ * gluster snapshot info [(snapname] | [vol <volname>)]
*/
ret = cli_snap_info_parse (dict, words, wordcount,
cmdi);
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index a958286..e8cda53 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -7956,6 +7956,10 @@ cli_call_snapshot_info (dict_t *dict, gf_boolean_t bool_snap_driven) {
goto out;
}
+ if (snap_count == 0) {
+ cli_out ("No snapshots present");
+ }
+
for (i = 1 ; i <= snap_count ; i++) {
ret = snprintf (key, sizeof (key), "snap%d", i);
if (ret < 0) {
@@ -8046,6 +8050,10 @@ cli_snapshot_list (dict_t *dict) {
goto out;
}
+ if (snapcount == 0) {
+ cli_out ("No snapshots present");
+ }
+
for (i = 1 ; i <= snapcount ; i++) {
ret = snprintf (key, sizeof (key), "snapname%d",i);
if (ret < 0) {
@@ -8257,6 +8265,10 @@ cli_snap_status_all (dict_t *dict) {
goto out;
}
+ if (snapcount == 0) {
+ cli_out ("No snapshots present");
+ }
+
for (i = 0 ; i < snapcount; i++) {
ret = snprintf (key, sizeof (key), "status.snap%d",i);
if (ret < 0) {