d6ffebebc53bde5c3a272628e0f95f89eaf0ed4e
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh
2new file mode 100644
3index 0000000000000000000000000000000000000000..1d72a2f2c13f20d33ee63f5ec9918621bdb6827a
4--- /dev/null
5+++ b/plugins/django/django.plugin.zsh
6@@ -0,0 +1,222 @@
7+#compdef manage.py
8+
9+typeset -ga nul_args
10+nul_args=(
11+ '--settings=-[the Python path to a settings module.]:file:_files'
12+ '--pythonpath=-[a directory to add to the Python path.]::directory:_directories'
13+ '--traceback[print traceback on exception.]'
14+ "--version[show program's version number and exit.]"
15+ {-h,--help}'[show this help message and exit.]'
16+)
17+
18+_managepy-adminindex(){
19+ _arguments -s : \
20+ $nul_args \
21+ '*::directory:_directories' && ret=0
22+}
23+
24+_managepy-createcachetable(){
25+ _arguments -s : \
26+ $nul_args && ret=0
27+}
28+
29+_managepy-dbshell(){
30+ _arguments -s : \
31+ $nul_args && ret=0
32+}
33+
34+_managepy-diffsettings(){
35+ _arguments -s : \
36+ $nul_args && ret=0
37+}
38+
39+_managepy-dumpdata(){
40+ _arguments -s : \
41+ '--format=-[specifies the output serialization format for fixtures.]:format:(json yaml xml)' \
42+ '--indent=-[specifies the indent level to use when pretty-printing output.]:' \
43+ $nul_args \
44+ '*::appname:_applist' && ret=0
45+}
46+
47+_managepy-flush(){
48+ _arguments -s : \
49+ '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
50+ '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
51+ $nul_args && ret=0
52+}
53+
54+_managepy-help(){
55+ _arguments -s : \
56+ '*:command:_managepy_cmds' \
57+ $nul_args && ret=0
58+}
59+
60+_managepy_cmds(){
61+ local line
62+ local -a cmd
63+ _call_program help-command ./manage.py help \
64+ |& sed -n '/^ /s/[(), ]/ /gp' \
65+ | while read -A line; do cmd=($line $cmd) done
66+ _describe -t managepy-command 'manage.py command' cmd
67+}
68+
69+_managepy-inspectdb(){
70+ _arguments -s : \
71+ $nul_args && ret=0
72+}
73+
74+_managepy-loaddata(){
75+ _arguments -s : \
76+ '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
77+ '*::file:_files' \
78+ $nul_args && ret=0
79+}
80+
81+_managepy-reset(){
82+ _arguments -s : \
83+ '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
84+ '*::appname:_applist' \
85+ $nul_args && ret=0
86+}
87+
88+_managepy-runfcgi(){
89+ local state
90+
91+ local fcgi_opts
92+ fcgi_opts=(
93+ 'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)'
94+ 'host[hostname to listen on..]:'
95+ 'port[port to listen on.]:'
96+ 'socket[UNIX socket to listen on.]::file:_files'
97+ 'method[prefork or threaded (default prefork)]:method:(prefork threaded)'
98+ 'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:'
99+ 'maxspare[max number of spare processes / threads.]:'
100+ 'minspare[min number of spare processes / threads.]:'
101+ 'maxchildren[hard limit number of processes / threads.]:'
102+ 'daemonize[whether to detach from terminal.]:boolean:(False True)'
103+ 'pidfile[write the spawned process-id to this file.]:file:_files'
104+ 'workdir[change to this directory when daemonizing.]:directory:_files'
105+ 'outlog[write stdout to this file.]:file:_files'