From c565624001a7464afaa34b596a4beaf20af9baf1 Mon Sep 17 00:00:00 2001 From: Evan Granito Date: Mon, 5 Oct 2026 22:25:45 -0400 Subject: [PATCH 1/2] _django: skip [section] headers in manage.py --help output From: Evan Granito Django groups subcommands by app and prints column-0 section headers such as [auth], [contenttypes], [django]. The current awk filter only drops lines before "Available subcommands" and strips the first two characters of every subsequent line, so those headers survive as bogus entries like "uth]", "jango]", "mber]", corrupting the completion list and producing mangled columnar output. Skip lines starting with "[" and only retain indented lines (the real subcommand entries), stripping the leading whitespace. --- Completion/Unix/Command/_django | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Completion/Unix/Command/_django b/Completion/Unix/Command/_django index 1d5cf7311..4893dcb64 100644 --- a/Completion/Unix/Command/_django +++ b/Completion/Unix/Command/_django @@ -57,7 +57,15 @@ case $state in ) for cmd in $(./manage.py --help 2>&1 >/dev/null | \ - awk -v drop=1 '{ if (!drop) print substr($0, 3) } /^Available subcommands/ { drop=0 }') + awk -v drop=1 ' + /^Available subcommands/ { drop = 0; next } + drop { next } + /^\[/ { next } + /^[[:space:]]/ { + sub(/^[[:space:]]+/, "") + print + } + ') do if ! echo $subcommands | grep -qs "${cmd}:" then -- 2.56.0