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): ...@@ -175,6 +175,8 @@ class Argument(object):
get_optional_desc_string(self.desc, "since"), get_optional_desc_string(self.desc, "since"),
_flags_code(), _flags_code(),
) )
if "deprecated_since" in self.desc:
s += ",.deprecated_since=\"%s\"" % self.desc["deprecated_since"]
if self.subargs: if self.subargs:
s += ",.subargs=%s" % self.subarg_table_name() 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 = [ GROUPS = [
"generic", "generic",
...@@ -66,16 +71,27 @@ def commands ...@@ -66,16 +71,27 @@ def commands
require "net/https" require "net/https"
require "json" require "json"
require "uri" require "uri"
if ARGV.length > 0
url = URI.parse "https://raw.githubusercontent.com/redis/redis-doc/master/commands.json" if ARGV[0] == '-'
client = Net::HTTP.new url.host, url.port data = STDIN.read
client.use_ssl = true elsif FileTest.exist? ARGV[0]
response = client.get url.path data = File.read(ARGV[0])
if response.is_a?(Net::HTTPSuccess) else
@commands = JSON.parse(response.body) raise Exception.new "File not found: #{ARGV[0]}"
end
else else
response.error! 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)
response.error!
return
else
data = response.body
end
end end
@commands = JSON.parse(data)
end end
def generate_groups 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