summaryrefslogtreecommitdiffstats
path: root/cli/src
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src')
-rw-r--r--cli/src/cli-cmd-parser.c20
-rw-r--r--cli/src/cli-cmd-snapshot.c3
2 files changed, 19 insertions, 4 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index bbec6aa5f8d..0981f11b7be 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -3397,7 +3397,9 @@ cli_snap_create_parse (dict_t *dict, const char **words, int wordcount) {
/* Filling volume name in the dictionary */
for (i = cmdi + 1 ; i < wordcount
&& (strcmp (words[i], "description")) != 0
- && (strcmp (words[i], "force") != 0); i++) {
+ && (strcmp (words[i], "force") != 0)
+ && (strcmp (words[i], "no-timestamp") != 0);
+ i++) {
volcount++;
/* volume index starts from 1 */
ret = snprintf (key, sizeof (key), "volname%"PRIu64, volcount);
@@ -3437,13 +3439,24 @@ cli_snap_create_parse (dict_t *dict, const char **words, int wordcount) {
/* Verify how we got out of "for" loop,
* if it is by reaching wordcount limit then goto "out",
- * because we need not parse for "description" and "force"
- * after this.
+ * because we need not parse for "description","force" and
+ * "no-timestamp" after this.
*/
if (i == wordcount) {
goto out;
}
+ if (strcmp (words[i], "no-timestamp") == 0) {
+ ret = dict_set_str (dict, "no-timestamp", "true");
+ if (ret) {
+ gf_log ("cli", GF_LOG_ERROR, "Could not save "
+ "time-stamp option");
+ }
+ if (i == (wordcount-1))
+ goto out;
+ i++;
+ }
+
if ((strcmp (words[i], "description")) == 0) {
++i;
if (i > (wordcount - 1)) {
@@ -4291,6 +4304,7 @@ cli_cmd_snapshot_parse (const char **words, int wordcount, dict_t **options,
case GF_SNAP_OPTION_TYPE_CREATE:
/* Syntax :
* gluster snapshot create <snapname> <vol-name(s)>
+ * [no-timestamp]
* [description <description>]
* [force]
*/
diff --git a/cli/src/cli-cmd-snapshot.c b/cli/src/cli-cmd-snapshot.c
index d03b5b99dd0..7c6a52e0a88 100644
--- a/cli/src/cli-cmd-snapshot.c
+++ b/cli/src/cli-cmd-snapshot.c
@@ -82,7 +82,8 @@ struct cli_cmd snapshot_cmds[] = {
cli_cmd_snapshot_help_cbk,
"display help for snapshot commands"
},
- { "snapshot create <snapname> <volname(s)> [description <description>] [force]",
+ { "snapshot create <snapname> <volname(s)> [no-timestamp] "
+ "[description <description>] [force]",
cli_cmd_snapshot_cbk,
"Snapshot Create."
},