Skip to content

Commit d0dd9f2

Browse files
committed
Updated commands.json to the version of 200160226
1 parent 22f7424 commit d0dd9f2

File tree

5 files changed

+2352
-120
lines changed

5 files changed

+2352
-120
lines changed

codegen/GenCmds.hs

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ groupCmds (Cmds cmds) =
4545
, "connection"
4646
, "server"
4747
, "scripting"
48+
-- not implemented:
49+
-- , "cluster"
50+
-- , "geo"
4851
]
4952

5053
-- |Blacklisted commands, optionally paired with the name of their
@@ -78,6 +81,39 @@ blacklist = [ manual "AUTH" ["auth"]
7881
["zrevrangebyscore", "zrevrangebyscoreWithscores"
7982
,"zrevrangebyscoreLimit", "zrevrangebyscoreWithscoresLimit"]
8083
, manual "ZUNIONSTORE" ["zunionstore","zunionstoreWeights"]
84+
, manualWithType "SET"
85+
["set", "setOpts"]
86+
["Condition", "SetOpts(..)"]
87+
, manualWithType "ZADD"
88+
["zadd", "zaddOpts"]
89+
["ZaddOpts(..)"]
90+
, manualWithType "MIGRATE"
91+
["migrate", "migrateMultiple"]
92+
["MigrateOpts(..)"]
93+
, manual "RESTORE"
94+
["restore", "restoreReplace"]
95+
, manualWithType "CLIENT REPLY"
96+
["clientReply"]
97+
["ReplyMode"]
98+
, manualWithType "SCRIPT DEBUG"
99+
["scriptDebug"]
100+
["DebugMode"]
101+
, manual "SRANDMEMBER" ["srandmember", "srandmemberN"]
102+
, manual "SPOP" ["spop"]
103+
, manual "INFO" ["info", "infoSection"]
104+
, manual "EXISTS" ["exists"]
105+
, unimplemented "COMMAND"
106+
, unimplemented "COMMAND GETKEYS"
107+
, unimplemented "ROLE"
108+
, unimplemented "CLIENT KILL"
109+
, unimplemented "SCAN"
110+
, unimplemented "SSCAN"
111+
, unimplemented "HSCAN"
112+
, unimplemented "ZSCAN"
113+
, unimplemented "ZRANGEBYLEX"
114+
, unimplemented "ZREVRANGEBYLEX"
115+
, unimplemented "ZRANGEBYSCORE"
116+
, unimplemented "ZREVRANGEBYSCORE"
81117
, unimplemented "MONITOR" -- debugging command
82118
, unimplemented "SYNC" -- internal command
83119
, unimplemented "SHUTDOWN" -- kills server, throws exception
@@ -101,7 +137,7 @@ data Cmd = Cmd { cmdName, cmdGroup :: String
101137
, cmdRetType :: Maybe String
102138
, cmdArgs :: [Arg]
103139
, cmdSummary :: String
104-
, cmdSince :: String
140+
, cmdSince :: Maybe String
105141
}
106142
deriving (Show)
107143

@@ -124,7 +160,7 @@ instance FromJSON Cmds where
124160
cmdGroup <- cmd .: "group"
125161
cmdRetType <- cmd .:? "returns"
126162
cmdSummary <- cmd .: "summary"
127-
cmdSince <- cmd .: "since"
163+
cmdSince <- cmd .:? "since"
128164
cmdArgs <- cmd .:? "arguments" .!= []
129165
<|> error ("failed to parse args: " ++ cmdName)
130166
return Cmd{..})
@@ -273,7 +309,9 @@ exportCmdNames Cmd{..} = types `mappend` functions
273309
, fromString "'."
274310
]
275311
else mempty
276-
, fromString " Since Redis ", fromString cmdSince
312+
, case cmdSince of
313+
Just ver -> mconcat [fromString " Since Redis ", fromString ver]
314+
Nothing -> fromString " In unstable version of Redis"
277315
]
278316

279317
cmdDescriptionLink :: String -> Builder
@@ -381,6 +419,7 @@ argumentType a = mconcat [ go a
381419
go (Pair a a') =
382420
mconcat [fromString "(", go a, fromString ",", go a', fromString ")"]
383421
go a@Arg{..} = translateArgType a
422+
go a = error ("failed to user argument type: " ++ show a)
384423

385424
translateArgType Arg{..} = fromString $ case argType of
386425
"integer" -> "Integer"

0 commit comments

Comments
 (0)