14f07ebc68da8b06cdb0a4fdb435ac928ff419f1

Author
alexandru <alex@hackd.net>
Committer
alexandru <alex@hackd.net>
Date

Message

redis-cli completion plugin

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/redis-cli/_redis-cli b/plugins/redis-cli/_redis-cli
  2new file mode 100644
  3index 0000000000000000000000000000000000000000..3789add182d2dd0283cf54ccece4f59a04513ac1
  4--- /dev/null
  5+++ b/plugins/redis-cli/_redis-cli
  6@@ -0,0 +1,142 @@
  7+#compdef redis-cli rec
  8+#autoload
  9+
 10+#redis cli completion, based off homebrew completion (ref. 2011-04-14)
 11+
 12+local -a _1st_arguments
 13+_1st_arguments=(
 14+  'append:append a value to a key'
 15+  'auth:authenticate to the server'
 16+  'bgrewriteeaof:asynchronously rewrite the append-only file'
 17+  'bgsave:asynchornously save the dataset to disk'
 18+  'blpop:remove and get the first element in a list, or block until one is available'
 19+  'brpop:remove and get the last element in a list, or block until one is available'
 20+  'brpoplpush:pop a value from a list, push it to another list and return it; or block until one is available'
 21+  # 'config get:get the value of a configuration parameter'
 22+  # 'config set:set a configuration parameter to the given value'
 23+  # 'config resetstat: reset the stats returned by INFO'
 24+  'dbsize:return the number of keys in the selected database'
 25+  # 'debug object:get debugging information about a key'
 26+  # 'debug setgfault:make the server crash'
 27+  'decr:decrement the integer value of a key by one'
 28+  'decrby:decrement the integet value of a key by the given number'
 29+  'del:delete a key'
 30+  'discard:discard all commands issued after MULTI'
 31+  'echo:echo the given string'
 32+  'exec:execute all commands issued after a MULTI'
 33+  'exists:determine if a key exists'
 34+  'expire:set the time to live for a key, in seconds'
 35+  'expireat:set the expiration for a key as a UNIX timestamp'
 36+  'flushall:remove all keys from all databases'
 37+  'flushdb:remove all keys from the current database'
 38+  'get:get the value of a key'
 39+  'getbit:returns the bit value at offset in the string value stored at key'
 40+  'getrange:get a substring of the string stored at a key'
 41+  'getset:set the string value of a key and return its old value'
 42+  'hdel:delete a hash field'
 43+  'hexists:determine if a hash field exists'
 44+  'hget:get the value of a hash field'
 45+  'hgetall:get all the fields and values in a hash'
 46+  'hincrby:increment the integer value of a hash field by the given number'
 47+  'hkeys:get all the fields in a hash'
 48+  'hlen:get the number of fields in a hash'
 49+  'hmget:get the values of all the given hash fields'
 50+  'hmset:set multiple hash fields to multiple values'
 51+  'hset:set the string value of a hash field'
 52+  'hsetnx:set the value of a hash field, only if the field does not exist'
 53+  'hvals:get all the values in a hash'
 54+  'incr:increment the integer value of a key by one'
 55+  'incrby:increment the integer value of a key by the given number'
 56+  'info:get information and statistics about the server'
 57+  'keys:find all keys matching the given pattern'
 58+  'lastsave:get the UNIX timestamp of the last successful save to disk'
 59+  'lindex:get an element from a list by its index'
 60+  'linset:insert an element before or after another element in a list'
 61+  'llen:get the length of a list'
 62+  'lpop:remove and get the first element in a list'
 63+  'lpush:prepend a value to a list'
 64+  'lpushx:prepend a value to a list, only if the list exists'
 65+  'lrange:get a range of elements from a list'
 66+  'lrem:remove elements from a list'
 67+  'lset:set the value of an element in a list by its index'
 68+  'ltrim:trim a list to the specified range'
 69+  'mget:get the values of all the given keys'
 70+  'monitor:listen for all requests received by the server in real time'
 71+  'move:move a key to another database'
 72+  'mset:set multiple keys to muliple values'
 73+  'msetnx:set multiple keys tom ultiple values, only if none of the keys exist'
 74+  'multi:mark the start of a transaction block'
 75+  'object:inspect the internals of Redis objects'
 76+  'persist:remove the expiration from a key'
 77+  'ping:ping the server'
 78+  'psubscribe:listen for messages published to channels matching the given patterns'
 79+  'publish:post a message to a channel'
 80+  'punsubscribe:stop listening for messages posted to channels matching the given patterns'
 81+  'quit:close the connection'
 82+  'randomkey:return a random key from the keyspace'
 83+  'rename:rename a key'
 84+  'renamenx:rename a key, only if the new key does not exist'
 85+  'rpop:remove and get the last element in a list'
 86+  'rpoplpush:remove the last element in a list, append it to another list and return it'
 87+  'rpush:append a value to a list'
 88+  'rpushx:append a value to a list, only if the list exists'
 89+  'sadd:add a member to a set'
 90+  'save:synchronously save the dataset to disk'
 91+  'scard:get the number of members in a set'
 92+  'sdiff:subtract multiple sets'
 93+  'sdiffstore:subtract multiple sets and store the resulting set in a key'
 94+  'select:change the selected database for the current connection'
 95+  'set:set the string value of a key'
 96+  'setbit:sets or clears the bit at offset in the string value stored at key'
 97+  'setex:set the value and expiration of a key'
 98+  'setnx:set the value of a key, only if the key does not exist'
 99+  'setrange:overwrite part of a string at key starting at the specified offset'
100+  'shutdown:synchronously save the dataset to disk and then shut down the server'
101+  'sinter:intersect multiple sets'
102+  'sinterstore:intersect multiple sets and store the resulting set in a key'
103+  'sismember:determine if a given value is a member of a set'
104+  'slaveof:make the server a slave of another instance, or promote it as master'
105+  'smembers:get all the members in a set'
106diff --git a/plugins/redis-cli/redis-cli.plugin.zsh b/plugins/redis-cli/redis-cli.plugin.zsh
107new file mode 100644
108index 0000000000000000000000000000000000000000..af5a843c98e413038cf03af86d2a387fdcc9cf2d
109--- /dev/null
110+++ b/plugins/redis-cli/redis-cli.plugin.zsh
111@@ -0,0 +1,4 @@
112+# add redis completion function to path
113+fpath=($ZSH/plugins/redis-cli $fpath)
114+autoload -U compinit
115+compinit -i