summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commands.c2
-rw-r--r--src/commands/sentinel-debug.json1
-rw-r--r--tests/sentinel/tests/14-debug-command.tcl9
3 files changed, 11 insertions, 1 deletions
diff --git a/src/commands.c b/src/commands.c
index e27588ddd..8277e6018 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -3718,7 +3718,7 @@ struct redisCommandArg SENTINEL_DEBUG_data_Subargs[] = {
/* SENTINEL DEBUG argument table */
struct redisCommandArg SENTINEL_DEBUG_Args[] = {
-{"data",ARG_TYPE_BLOCK,-1,NULL,NULL,NULL,CMD_ARG_MULTIPLE,.subargs=SENTINEL_DEBUG_data_Subargs},
+{"data",ARG_TYPE_BLOCK,-1,NULL,NULL,NULL,CMD_ARG_OPTIONAL|CMD_ARG_MULTIPLE,.subargs=SENTINEL_DEBUG_data_Subargs},
{0}
};
diff --git a/src/commands/sentinel-debug.json b/src/commands/sentinel-debug.json
index 8328c45b8..dac2f6b60 100644
--- a/src/commands/sentinel-debug.json
+++ b/src/commands/sentinel-debug.json
@@ -16,6 +16,7 @@
{
"name": "data",
"type": "block",
+ "optional": true,
"multiple": true,
"arguments": [
{
diff --git a/tests/sentinel/tests/14-debug-command.tcl b/tests/sentinel/tests/14-debug-command.tcl
new file mode 100644
index 000000000..dccb992a9
--- /dev/null
+++ b/tests/sentinel/tests/14-debug-command.tcl
@@ -0,0 +1,9 @@
+source "../tests/includes/init-tests.tcl"
+
+test "Sentinel debug test with arguments and without argument" {
+ set current_info_period [lindex [S 0 SENTINEL DEBUG] 1]
+ S 0 SENTINEL DEBUG info-period 8888
+ assert_equal {8888} [lindex [S 0 SENTINEL DEBUG] 1]
+ S 0 SENTINEL DEBUG info-period $current_info_period
+ assert_equal $current_info_period [lindex [S 0 SENTINEL DEBUG] 1]
+}