summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Granito <evang@tutamail.com>2026-10-05 22:41:10 -0400
committerOliver Kiddle <opk@zsh.org>2026-10-10 00:56:23 +0200
commit202b894f58d9b0902aae37b2de8152920830bf5d (patch)
tree0eac3b93b8de216363e0a967122d93771e7d8979
parent55196: _django: skip [section] headers in manage.py --help output (diff)
downloadzsh-202b894f58d9b0902aae37b2de8152920830bf5d.tar
zsh-202b894f58d9b0902aae37b2de8152920830bf5d.tar.gz
zsh-202b894f58d9b0902aae37b2de8152920830bf5d.tar.bz2
zsh-202b894f58d9b0902aae37b2de8152920830bf5d.tar.lz
zsh-202b894f58d9b0902aae37b2de8152920830bf5d.tar.xz
zsh-202b894f58d9b0902aae37b2de8152920830bf5d.tar.zst
zsh-202b894f58d9b0902aae37b2de8152920830bf5d.zip
55196: _django: drop stale pre-1.9 command list
The hardcoded subcommands array lists commands removed from Django between 1.9 and 1.10 (reset, runfcgi, sql, sqlall, sqlclear, sqlcustom, sqlindexes, sqlreset, syncdb, validate). The last Django release that shipped these commands was 1.8, which reached end of life in April 2018. These entries cannot provide backward compatibility: the file also parses manage.py --help at runtime, which would already surface them on any Django version that still has them. On every modern Django release, however, they appear as phantom entries that produce "Unknown command" when selected. Drop the list and rely entirely on the runtime parse. This eliminates the maintenance burden that caused it to drift out of date.
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_django39
2 files changed, 6 insertions, 36 deletions
diff --git a/ChangeLog b/ChangeLog
index 4649d410f..c1edee210 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
2026-10-09 Oliver Kiddle <opk@zsh.org>
* Evan Granito: 55196: Completion/Unix/Command/_django:
+ drop stale pre-1.9 command list
+
+ * Evan Granito: 55196: Completion/Unix/Command/_django:
skip [section] headers in manage.py --help output
* Christopher Bock: 55180: Completion/Unix/Command/_libvirt:
diff --git a/Completion/Unix/Command/_django b/Completion/Unix/Command/_django
index 4893dcb64..beae82776 100644
--- a/Completion/Unix/Command/_django
+++ b/Completion/Unix/Command/_django
@@ -24,38 +24,8 @@ _arguments -C \
case $state in
subcommand)
- subcommands=(
- "cleanup:remove old data from the database"
- "compilemessages:compile .po files to .mo for use with gettext"
- "createcachetable:creates table for SQL cache backend"
- "createsuperuser:create a superuser"
- "dbshell:run command-line client for the current database"
- "diffsettings:display differences between the current settings and Django defaults"
- "dumpdata:output contents of database as a fixture"
- "flush:execute 'sqlflush' on the current database"
- "inspectdb:output Django model module for tables in database"
- "loaddata:install the named fixture(s) in the database"
- "makemessages:pull out all strings marked for translation"
- "reset:executes 'sqlreset' for the given app(s)"
- "runfcgi:run this project as a fastcgi"
- "runserver:start a lightweight web server for development"
- "shell:run a Python interactive interpreter. Tries to use IPython, if it's available"
- "sql:print the CREATE TABLE statements for the given app(s)"
- "sqlall:print the CREATE TABLE, CREATE INDEX and custom statements for the given app(s)"
- "sqlclear:print the DROP TABLE statements for the given app(s)"
- "sqlcustom:print the custom table-modifying SQL statements for the given app(s)"
- "sqlflush:print the SQL statements required to return all tables to installation state"
- "sqlindexes:print the CREATE INDEX statements for the given app(s)"
- "sqlreset:print the DROP TABLE and CREATE TABLE statements for the given app(s)"
- "sqlsequencereset:print the SQL statements for resetting sequences for the given app(s)"
- "startapp:create Django app directory in this project's directory"
- "startproject:create a Django project directory structure for a given project name"
- "syncdb:create database tables for apps in INSTALLED_APPS where required"
- "test:run the test suite for the specified app, or the entire site"
- "testserver:run a development server with data from the given fixture(s)"
- "validate:validate all installed modules"
- )
-
+ local -a subcommands
+ subcommands=()
for cmd in $(./manage.py --help 2>&1 >/dev/null | \
awk -v drop=1 '
/^Available subcommands/ { drop = 0; next }
@@ -67,10 +37,7 @@ case $state in
}
')
do
- if ! echo $subcommands | grep -qs "${cmd}:"
- then
- subcommands+=($cmd)
- fi
+ subcommands+=($cmd)
done
_describe -t subcommands 'django admin subcommand' subcommands && ret=0