Created
March 31, 2017 19:53
-
-
Save cmason/48ced23c90cf4325e4bf05f32e6b34fd to your computer and use it in GitHub Desktop.
Use redis-cli with a URI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'uri' | |
if ARGV.empty? | |
puts "Usage: redis-cli-uri <uri> [REDIS-CLI OPTIONS] [cmd [arg [arg ...]]]" | |
exit 1 | |
end | |
uri = URI.parse(ARGV.shift) | |
system(%Q(redis-cli -h "#{uri.host}" -p "#{uri.port}" -a "#{uri.password}" #{ARGV.join(' ')})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment