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