_redis-cli 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #compdef redis-cli rec
  2. #autoload
  3. #redis cli completion, based off homebrew completion (ref. 2011-04-14)
  4. local -a _1st_arguments
  5. _1st_arguments=(
  6. 'append:append a value to a key'
  7. 'auth:authenticate to the server'
  8. 'bgrewriteeaof:asynchronously rewrite the append-only file'
  9. 'bgsave:asynchornously save the dataset to disk'
  10. 'blpop:remove and get the first element in a list, or block until one is available'
  11. 'brpop:remove and get the last element in a list, or block until one is available'
  12. 'brpoplpush:pop a value from a list, push it to another list and return it; or block until one is available'
  13. # 'config get:get the value of a configuration parameter'
  14. # 'config set:set a configuration parameter to the given value'
  15. # 'config resetstat: reset the stats returned by INFO'
  16. 'dbsize:return the number of keys in the selected database'
  17. # 'debug object:get debugging information about a key'
  18. # 'debug setgfault:make the server crash'
  19. 'decr:decrement the integer value of a key by one'
  20. 'decrby:decrement the integet value of a key by the given number'
  21. 'del:delete a key'
  22. 'discard:discard all commands issued after MULTI'
  23. 'echo:echo the given string'
  24. 'exec:execute all commands issued after a MULTI'
  25. 'exists:determine if a key exists'
  26. 'expire:set the time to live for a key, in seconds'
  27. 'expireat:set the expiration for a key as a UNIX timestamp'
  28. 'flushall:remove all keys from all databases'
  29. 'flushdb:remove all keys from the current database'
  30. 'get:get the value of a key'
  31. 'getbit:returns the bit value at offset in the string value stored at key'
  32. 'getrange:get a substring of the string stored at a key'
  33. 'getset:set the string value of a key and return its old value'
  34. 'hdel:delete a hash field'
  35. 'hexists:determine if a hash field exists'
  36. 'hget:get the value of a hash field'
  37. 'hgetall:get all the fields and values in a hash'
  38. 'hincrby:increment the integer value of a hash field by the given number'
  39. 'hkeys:get all the fields in a hash'
  40. 'hlen:get the number of fields in a hash'
  41. 'hmget:get the values of all the given hash fields'
  42. 'hmset:set multiple hash fields to multiple values'
  43. 'hset:set the string value of a hash field'
  44. 'hsetnx:set the value of a hash field, only if the field does not exist'
  45. 'hvals:get all the values in a hash'
  46. 'incr:increment the integer value of a key by one'
  47. 'incrby:increment the integer value of a key by the given number'
  48. 'info:get information and statistics about the server'
  49. 'keys:find all keys matching the given pattern'
  50. 'lastsave:get the UNIX timestamp of the last successful save to disk'
  51. 'lindex:get an element from a list by its index'
  52. 'linset:insert an element before or after another element in a list'
  53. 'llen:get the length of a list'
  54. 'lpop:remove and get the first element in a list'
  55. 'lpush:prepend a value to a list'
  56. 'lpushx:prepend a value to a list, only if the list exists'
  57. 'lrange:get a range of elements from a list'
  58. 'lrem:remove elements from a list'
  59. 'lset:set the value of an element in a list by its index'
  60. 'ltrim:trim a list to the specified range'
  61. 'mget:get the values of all the given keys'
  62. 'monitor:listen for all requests received by the server in real time'
  63. 'move:move a key to another database'
  64. 'mset:set multiple keys to muliple values'
  65. 'msetnx:set multiple keys tom ultiple values, only if none of the keys exist'
  66. 'multi:mark the start of a transaction block'
  67. 'object:inspect the internals of Redis objects'
  68. 'persist:remove the expiration from a key'
  69. 'ping:ping the server'
  70. 'psubscribe:listen for messages published to channels matching the given patterns'
  71. 'publish:post a message to a channel'
  72. 'punsubscribe:stop listening for messages posted to channels matching the given patterns'
  73. 'quit:close the connection'
  74. 'randomkey:return a random key from the keyspace'
  75. 'rename:rename a key'
  76. 'renamenx:rename a key, only if the new key does not exist'
  77. 'rpop:remove and get the last element in a list'
  78. 'rpoplpush:remove the last element in a list, append it to another list and return it'
  79. 'rpush:append a value to a list'
  80. 'rpushx:append a value to a list, only if the list exists'
  81. 'sadd:add a member to a set'
  82. 'save:synchronously save the dataset to disk'
  83. 'scard:get the number of members in a set'
  84. 'sdiff:subtract multiple sets'
  85. 'sdiffstore:subtract multiple sets and store the resulting set in a key'
  86. 'select:change the selected database for the current connection'
  87. 'set:set the string value of a key'
  88. 'setbit:sets or clears the bit at offset in the string value stored at key'
  89. 'setex:set the value and expiration of a key'
  90. 'setnx:set the value of a key, only if the key does not exist'
  91. 'setrange:overwrite part of a string at key starting at the specified offset'
  92. 'shutdown:synchronously save the dataset to disk and then shut down the server'
  93. 'sinter:intersect multiple sets'
  94. 'sinterstore:intersect multiple sets and store the resulting set in a key'
  95. 'sismember:determine if a given value is a member of a set'
  96. 'slaveof:make the server a slave of another instance, or promote it as master'
  97. 'smembers:get all the members in a set'
  98. 'smove:move a member from one set to another'
  99. 'sort:sort the elements in a list, set or sorted set'
  100. 'spop:remove and return a random member from a set'
  101. 'srandmember:get a random member from a set'
  102. 'srem:remove a member from a set'
  103. 'strlen:get the length of the value stored in a key'
  104. 'subscribe:listen for messages published to the given channels'
  105. 'sunion:add multiple sets'
  106. 'sunionstore:add multiple sets and store the resulting set in a key'
  107. 'ttl:get the time to live for a key'
  108. 'type:determine the type stored at key'
  109. 'unsubscribe:stop listening for messages posted to the given channels'
  110. 'unwatch:forget about all watched keys'
  111. 'watch:watch the given keys to determine execution of the MULTI/EXEC block'
  112. 'zadd:add a member to a sorted set, or update its score if it already exists'
  113. 'zcard:get the number of members in a sorted set'
  114. 'zcount:count the members in a sorted set with scores within the given values'
  115. 'zincrby:increment the score of a member in a sorted set'
  116. 'zinterstore:intersect multiple sorted sets and store the resulting sorted set in a new key'
  117. 'zrange:return a range of members in a sorted set, by index'
  118. 'zrangebyscore:return a range of members in a sorted set, by score'
  119. 'zrank:determine the index of a member in a sorted set'
  120. 'zrem:remove a member from a sorted set'
  121. 'zremrangebyrank:remove all members in a sorted set within the given indexes'
  122. 'zremrangebyscore:remove all members in a sorted set within the given scores'
  123. 'zrevrange:return a range of membrs in a sorted set, by index, with scores ordered from high to low'
  124. 'zrevrangebyscore:return a range of members in a sorted set, by score, with scores ordered from high to low'
  125. 'zrevrank:determine the index of a member in a sorted set, with scores ordered from high to low'
  126. 'zscore:get the score associated with the given member in a sorted set'
  127. 'zunionstore:add multiple sorted sets and store te resulting sorted set in a new key'
  128. )
  129. local expl
  130. _arguments \
  131. '(-v --version)'{-v,--version}'[show version]' \
  132. '(-h --help)'{-h,--help}'[show help]' \
  133. '*:: :->subcmds' && return 0
  134. if (( CURRENT == 1 )); then
  135. _describe -t commands "redis-cli subcommand" _1st_arguments
  136. return
  137. fi