about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Completion/Unix/Command/_django9
2 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f49d57788..d923d8e90 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-01  Clint Adams  <clint@zsh.org>
+
+	* Chris Lamb: 26655: Completion/Unix/Command/_django: complete
+	custom Django management commands.
+
 2009-02-28  Clint Adams  <clint@zsh.org>
 
 	* Daniel Friesel: 26636: Completion/X/Command/_mplayer: complete
@@ -11271,5 +11276,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4585 $                         
+* $Revision: 1.4586 $                         
 *****************************************************
diff --git a/Completion/Unix/Command/_django b/Completion/Unix/Command/_django
index 82d5910f3..20d93c376 100644
--- a/Completion/Unix/Command/_django
+++ b/Completion/Unix/Command/_django
@@ -57,6 +57,15 @@ case $state in
       "testserver:run a development server with data from the given fixture(s)"
       "validate:validate all installed modules"
     )
+
+    for cmd in $(./manage.py --help 2>&1 >/dev/null | \
+        awk -vdrop=1 '{ if (!drop) print substr($0, 3) } /^Available subcommands/ { drop=0 }')
+    do
+        if ! echo $subcommands | grep -qs "${cmd}:"
+        then
+            subcommands+=($cmd)
+        fi
+    done
     
     _describe -t subcommands 'django admin subcommand' subcommands && ret=0
     ;;