Opened 16 years ago

Closed 15 years ago

Last modified 13 years ago

#10752 closed (fixed)

Advanced Bash Completion

Reported by: Arthur Koziel Owned by: Arthur Koziel
Component: Core (Management commands) Version: dev
Severity: Keywords: bash completion
Cc: flosch@… Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This patch improves the bash completion. It calls a python function which uses the get_commands() method to return subcommand suggestions. It also goes through the optparse parser to get option suggestions for a subcommand. There are special cases, like the 'runfcgi' command which uses a python dict to store its options.

This makes it possible to have subcommand completion of 3rd party apps (like django-command-extension).

It's a little hard to explain, so I tried to make a screencast:
http://media.arthurkoziel.com/django/bashcomp.mov

Installation hasn't changed, just source the django_bash_completion file from extras/

Attachments (4)

django_bash_completion.diff (9.5 KB ) - added by Arthur Koziel 16 years ago.
django_bash_completion.2.diff (9.3 KB ) - added by Arthur Koziel 16 years ago.
django_bash_completion.3.diff (9.1 KB ) - added by Arthur Koziel 16 years ago.
added "-o default" back in
django_bash_completion.4.diff (9.6 KB ) - added by Arthur Koziel 15 years ago.
Added app completion for some commands

Download all attachments as: .zip

Change History (14)

by Arthur Koziel, 16 years ago

Attachment: django_bash_completion.diff added

comment:1 by Jannis Leidel, 16 years ago

Component: Uncategorizeddjango-admin.py
milestone: 1.21.1
Triage Stage: UnreviewedAccepted

comment:2 by Jannis Leidel, 16 years ago

Needs documentation: set

comment:3 by flosch, 16 years ago

Cc: flosch@… added

comment:4 by Jacob, 16 years ago

milestone: 1.11.2

comment:5 by Rob Hudson <treborhudson@…>, 16 years ago

Just tested it and it works very nicely. Great work! Can't wait for this to land.

by Arthur Koziel, 16 years ago

comment:6 by Arthur Koziel, 16 years ago

django_bash_completion.2.diff cleans up the code and resolves some inconsistencies with --help and runfcgi.

comment:7 by Arthur Koziel, 16 years ago

Owner: changed from nobody to Arthur Koziel

by Arthur Koziel, 16 years ago

added "-o default" back in

comment:8 by Eric Holscher, 15 years ago

Just wanted to say thanks to arthurk, because I have a local branch of this ticket and it has proved super useful.

by Arthur Koziel, 15 years ago

Added app completion for some commands

comment:9 by jkocherhans, 15 years ago

Resolution: fixed
Status: newclosed

(In [11526]) Fixed #10752. Added more advanced bash completion. Thanks, Arthur Koziel.

comment:10 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top