Skip to content

Commit

Permalink
redis-trib: allow support for mandatory options.
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed May 9, 2014
1 parent 72ff033 commit 74435ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/redis-trib.rb
Expand Up @@ -1019,6 +1019,14 @@ def parse_options(cmd)
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
Expand Down

0 comments on commit 74435ab

Please sign in to comment.