improve manage.py completion #188
This commit is contained in:
parent
3c3e6a653b
commit
6ea9474bae
|
@ -1,4 +1,4 @@
|
||||||
#compdef manage.py
|
#compdef manage.py django-admin.py
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Description
|
# Description
|
||||||
# -----------
|
# -----------
|
||||||
|
@ -16,11 +16,8 @@
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
_managepy-adminindex(){
|
_managepy-cleanup(){}
|
||||||
_arguments -s : \
|
_managepy-compilemessages(){}
|
||||||
$nul_args \
|
|
||||||
'*::directory:_directories' && ret=0
|
|
||||||
}
|
|
||||||
|
|
||||||
_managepy-createcachetable(){
|
_managepy-createcachetable(){
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
|
@ -79,6 +76,8 @@ _managepy-loaddata(){
|
||||||
$nul_args && ret=0
|
$nul_args && ret=0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_managepy-makemessages(){}
|
||||||
|
|
||||||
_managepy-reset(){
|
_managepy-reset(){
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \
|
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \
|
||||||
|
@ -174,11 +173,17 @@ _managepy-validate() {
|
||||||
$nul_args && ret=0
|
$nul_args && ret=0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_managepy-changepassword(){}
|
||||||
|
_managepy-createsuperuser(){}
|
||||||
|
_managepy-collectstatic(){}
|
||||||
|
_managepy-findstatic(){}
|
||||||
|
|
||||||
_managepy-commands() {
|
_managepy-commands() {
|
||||||
local -a commands
|
local -a commands
|
||||||
|
|
||||||
commands=(
|
commands=(
|
||||||
'adminindex:prints the admin-index template snippet for the given app name(s).'
|
'cleanup:Can be run as a cronjob or directly to clean out old data from the database (only expired sessions at the moment).'
|
||||||
|
'compilemessages:Compiles .po files to .mo files for use with builtin gettext support.'
|
||||||
'createcachetable:creates the table needed to use the SQL cache backend.'
|
'createcachetable:creates the table needed to use the SQL cache backend.'
|
||||||
'dbshell:runs the command-line client for the current DATABASE_ENGINE.'
|
'dbshell:runs the command-line client for the current DATABASE_ENGINE.'
|
||||||
"diffsettings:displays differences between the current settings.py and Django's default settings."
|
"diffsettings:displays differences between the current settings.py and Django's default settings."
|
||||||
|
@ -187,6 +192,7 @@ _managepy-commands() {
|
||||||
'help:manage.py help.'
|
'help:manage.py help.'
|
||||||
'inspectdb:Introspects the database tables in the given database and outputs a Django model module.'
|
'inspectdb:Introspects the database tables in the given database and outputs a Django model module.'
|
||||||
'loaddata:Installs the named fixture(s) in the database.'
|
'loaddata:Installs the named fixture(s) in the database.'
|
||||||
|
'makemessages:Runs over the entire source tree of the current directory and pulls out all strings marked for translation.'
|
||||||
'reset:Executes ``sqlreset`` for the given app(s) in the current database.'
|
'reset:Executes ``sqlreset`` for the given app(s) in the current database.'
|
||||||
'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,'
|
'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,'
|
||||||
'runserver:Starts a lightweight Web server for development.'
|
'runserver:Starts a lightweight Web server for development.'
|
||||||
|
@ -207,6 +213,14 @@ _managepy-commands() {
|
||||||
'testserver:Runs a development server with data from the given fixture(s).'
|
'testserver:Runs a development server with data from the given fixture(s).'
|
||||||
'validate:Validates all installed models.'
|
'validate:Validates all installed models.'
|
||||||
)
|
)
|
||||||
|
if [[ $words[1] =~ "manage.py$" ]]; then
|
||||||
|
commands=($commands
|
||||||
|
"changepassword:Change a user's password for django.contrib.auth."
|
||||||
|
'createsuperuser:Used to create a superuser.'
|
||||||
|
'collectstatic:Collect static files in a single location.'
|
||||||
|
'findstatic:Finds the absolute paths for the given static file(s).'
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
_describe -t commands 'manage.py command' commands && ret=0
|
_describe -t commands 'manage.py command' commands && ret=0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue