Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
20618c71
Commit
20618c71
authored
Apr 27, 2022
by
Oran Agra
Browse files
Merge remote-tracking branch 'origin/unstable' into 7.0
parents
fb4e0d40
89772ed8
Changes
122
Hide whitespace changes
Inline
Side-by-side
utils/generate-command-code.py
View file @
20618c71
...
...
@@ -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
()
...
...
utils/generate-command-help.rb
View file @
20618c71
#!/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"
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
)
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
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
@commands
=
JSON
.
parse
(
data
)
end
def
generate_groups
...
...
Prev
1
…
3
4
5
6
7
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment