diff options
author | Yossi Gottlieb <yossigo@gmail.com> | 2022-01-27 21:48:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 21:48:06 +0200 |
commit | 068190a8029a47b5ce10b5f7f2a208d1e99a6f00 (patch) | |
tree | 6f73f26102f8c2d172fb3f6b2b11cc3a4452b654 /utils | |
parent | d6169258351e58ce1c0cfc01ba9c85e2a5b15ffb (diff) | |
download | redis-068190a8029a47b5ce10b5f7f2a208d1e99a6f00.tar.gz |
Update generate-command-help.rb and help.h. (#10196)
There are some inevitable changes between the old and new output, as a
result of the different `commands.json` semantics.
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/generate-command-help.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/utils/generate-command-help.rb b/utils/generate-command-help.rb index 003a593bd..482a3b9f8 100755 --- a/utils/generate-command-help.rb +++ b/utils/generate-command-help.rb @@ -5,7 +5,7 @@ GROUPS = [ "string", "list", "set", - "sorted_set", + "sorted-set", "hash", "pubsub", "transactions", @@ -27,17 +27,24 @@ GROUPS_BY_NAME = Hash[* def argument arg if "block" == arg["type"] - name = arg["block"].map do |entry| + name = arg["arguments"].map do |entry| argument entry end.join " " + elsif "oneof" == arg["type"] + name = arg["arguments"].map do |entry| + argument entry + end.join "|" + elsif "pure-token" == arg["type"] + name = nil # prepended later else name = arg["name"].is_a?(Array) ? arg["name"].join(" ") : arg["name"] - name = arg["enum"].join "|" if "enum" == arg["type"] - name = arg["command"] + (name ? " " + name : "") if arg["command"] end if arg["multiple"] name = "#{name} [#{name} ...]" end + if arg["token"] + name = [arg["token"], name].compact.join " " + end if arg["optional"] name = "[#{name}]" end |