From 630a447449a2b36f9fb7c9ca7d4b44fdb8d48184 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 9 May 2014 16:11:11 +0200 Subject: [PATCH] redis-trib: allow support for mandatory options. --- src/redis-trib.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/redis-trib.rb b/src/redis-trib.rb index 743c87442..8d16700bd 100755 --- a/src/redis-trib.rb +++ b/src/redis-trib.rb @@ -1019,6 +1019,14 @@ class RedisTrib break end end + + # Enforce mandatory options + ALLOWED_OPTIONS[cmd].each {|option,val| + if !options[option] && val == :required + puts "Option '--#{option}' is required for subcommand '#{cmd}'" + exit 1 + end + } return options,idx end end