a18fa835503acb44ac656c5bb592873e66bd40f1
- Author
- dongweiming <ciici123@gmail.com>
- Committer
- dongweiming <ciici123@gmail.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/celery/_celery b/plugins/celery/_celery
2new file mode 100644
3index 0000000000000000000000000000000000000000..63af9fad58ce471950a5a64fee088356512b38c2
4--- /dev/null
5+++ b/plugins/celery/_celery
6@@ -0,0 +1,129 @@
7+#compdef celery
8+#autoload
9+
10+#celery zsh completion
11+
12+_celery () {
13+local -a _1st_arguments ifargs dopts controlargs
14+
15+typeset -A opt_args
16+
17+_1st_arguments=('worker' 'events' 'beat' 'shell' 'multi' 'amqp' 'status' 'inspect' \
18+ 'control' 'purge' 'list' 'migrate' 'call' 'result' 'report')
19+ifargs=('--app=' '--broker=' '--loader=' '--config=' '--version')
20+dopts=('--detach' '--umask=' '--gid=' '--uid=' '--pidfile=' '--logfile=' '--loglevel=')
21+controlargs=('--timeout' '--destination')
22+_arguments \
23+ '(-A --app=)'{-A,--app}'[app instance to use (e.g. module.attr_name):APP]' \
24+ '(-b --broker=)'{-b,--broker}'[url to broker. default is "amqp://guest@localhost//":BROKER]' \
25+ '(--loader)--loader[name of custom loader class to use.:LOADER]' \
26+ '(--config)--config[Name of the configuration module:CONFIG]' \
27+ '(--workdir)--workdir[Optional directory to change to after detaching.:WORKING_DIRECTORY]' \
28+ '(-q --quiet)'{-q,--quiet}'[Don"t show as much output.]' \
29+ '(-C --no-color)'{-C,--no-color}'[Don"t display colors.]' \
30+ '(--version)--version[show program"s version number and exit]' \
31+ '(- : *)'{-h,--help}'[show this help message and exit]' \
32+ '*:: :->subcmds' && return 0
33+
34+if (( CURRENT == 1 )); then
35+ _describe -t commands "celery subcommand" _1st_arguments
36+ return
37+fi
38+
39+case "$words[1]" in
40+ worker)
41+ _arguments \
42+ '(-C --concurrency=)'{-C,--concurrency=}'[Number of child processes processing the queue. The default is the number of CPUs.]' \
43+ '(--pool)--pool=:::(processes eventlet gevent threads solo)' \
44+ '(--purge --discard)'{--discard,--purge}'[Purges all waiting tasks before the daemon is started.]' \
45+ '(-f --logfile=)'{-f,--logfile=}'[Path to log file. If no logfile is specified, stderr is used.]' \
46+ '(--loglevel=)--loglevel=:::(critical error warning info debug)' \
47+ '(-N --hostname=)'{-N,--hostname=}'[Set custom hostname, e.g. "foo.example.com".]' \
48+ '(-B --beat)'{-B,--beat}'[Also run the celerybeat periodic task scheduler.]' \
49+ '(-s --schedule=)'{-s,--schedule=}'[Path to the schedule database if running with the -B option. Defaults to celerybeat-schedule.]' \
50+ '(-S --statedb=)'{-S,--statedb=}'[Path to the state database.Default: None]' \
51+ '(-E --events)'{-E,--events}'[Send events that can be captured by monitors like celeryev, celerymon, and others.]' \
52+ '(--time-limit=)--time-limit=[nables a hard time limit (in seconds int/float) for tasks]' \
53+ '(--soft-time-limit=)--soft-time-limit=[Enables a soft time limit (in seconds int/float) for tasks]' \
54+ '(--maxtasksperchild=)--maxtasksperchild=[Maximum number of tasks a pool worker can execute before it"s terminated and replaced by a new worker.]' \
55+ '(-Q --queues=)'{-Q,--queues=}'[List of queues to enable for this worker, separated by comma. By default all configured queues are enabled.]' \
56+ '(-I --include=)'{-I,--include=}'[Comma separated list of additional modules to import.]' \
57+ '(--pidfile=)--pidfile=[Optional file used to store the process pid.]' \
58+ '(--autoscale=)--autoscale=[Enable autoscaling by providing max_concurrency, min_concurrency.]' \
59+ '(--autoreload)--autoreload[Enable autoreloading.]' \
60+ '(--no-execv)--no-execv[Don"t do execv after multiprocessing child fork.]'
61+ compadd -a ifargs
62+ ;;
63+ inspect)
64+ _values -s \
65+ 'active[dump active tasks (being processed)]' \
66+ 'active_queues[dump queues being consumed from]' \
67+ 'ping[ping worker(s)]' \
68+ 'registered[dump of registered tasks]' \
69+ 'report[get bugreport info]' \
70+ 'reserved[dump reserved tasks (waiting to be processed)]' \
71+ 'revoked[dump of revoked task ids]' \
72+ 'scheduled[dump scheduled tasks (eta/countdown/retry)]' \
73+ 'stats[dump worker statistics]'
74+ compadd -a controlargs ifargs
75+ ;;
76+ control)
77+ _values -s \
78+ 'add_consumer[tell worker(s) to start consuming a queue]' \
79+ 'autoscale[change autoscale settings]' \
80+ 'cancel_consumer[tell worker(s) to stop consuming a queue]' \
81+ 'disable_events[tell worker(s) to disable events]' \
82+ 'enable_events[tell worker(s) to enable events]' \
83+ 'pool_grow[start more pool processes]' \
84+ 'pool_shrink[use less pool processes]' \
85+ 'rate_limit[tell worker(s) to modify the rate limit for a task type]' \
86+ 'time_limit[tell worker(s) to modify the time limit for a task type.]'
87+ compadd -a controlargs ifargs
88+ ;;
89+ multi)
90+ _values -s \
91+ '--nosplash[Don"t display program info.]' \
92+ '--verbose[Show more output.]' \
93+ '--no-color[Don"t display colors.]' \
94+ '--quiet[Don"t show as much output.]' \
95+ 'start' 'restart' 'stopwait' 'stop' 'show' \
96+ 'names' 'expand' 'get' 'kill'
97+ compadd -a ifargs
98+ ;;
99+ amqp)
100+ _values -s \
101+ 'queue.declare' 'queue.purge' 'exchange.delete' 'basic.publish' \
102+ 'exchange.declare' 'queue.delete' 'queue.bind' 'basic.get'
103+ ;;
104+ list)
105+ _values -s, 'bindings'