Commit 20618c71 authored by Oran Agra's avatar Oran Agra
Browse files

Merge remote-tracking branch 'origin/unstable' into 7.0

parents fb4e0d40 89772ed8
......@@ -175,6 +175,8 @@ class Argument(object):
get_optional_desc_string(self.desc, "since"),
_flags_code(),
)
if "deprecated_since" in self.desc:
s += ",.deprecated_since=\"%s\"" % self.desc["deprecated_since"]
if self.subargs:
s += ",.subargs=%s" % self.subarg_table_name()
......
#!/usr/bin/env ruby
#!/usr/bin/env ruby -w
# Usage: generate-command-help.r [path/to/commands.json]
# or: generate-commands-json.py | generate-command-help.rb -
#
# Defaults to downloading commands.json from the redis-doc repo if not provided
# or STDINed.
GROUPS = [
"generic",
......@@ -66,16 +71,27 @@ def commands
require "net/https"
require "json"
require "uri"
if ARGV.length > 0
if ARGV[0] == '-'
data = STDIN.read
elsif FileTest.exist? ARGV[0]
data = File.read(ARGV[0])
else
raise Exception.new "File not found: #{ARGV[0]}"
end
else
url = URI.parse "https://raw.githubusercontent.com/redis/redis-doc/master/commands.json"
client = Net::HTTP.new url.host, url.port
client.use_ssl = true
response = client.get url.path
if response.is_a?(Net::HTTPSuccess)
@commands = JSON.parse(response.body)
else
if !response.is_a?(Net::HTTPSuccess)
response.error!
return
else
data = response.body
end
end
@commands = JSON.parse(data)
end
def generate_groups
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment