From 74435aba4794cfd0a29f8c746abae902aaaf8295 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 743c8744..8d16700b 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