root / snf-webproject / extras / snf_manage_bash_completion @ b29a81b1
History | View | Annotate | Download (1.2 kB)
1 |
# ######################################################################### |
---|---|
2 |
# This bash script adds tab-completion feature to django-admin.py and |
3 |
# manage.py. |
4 |
# |
5 |
# Testing it out without installing |
6 |
# ================================= |
7 |
# |
8 |
# To test out the completion without "installing" this, just run this file |
9 |
# directly, like so: |
10 |
# |
11 |
# . ~/path/to/synnefo_bash_completion |
12 |
# |
13 |
# Note: There's a dot ('.') at the beginning of that command. |
14 |
# |
15 |
# After you do that, tab completion will immediately be made available in your |
16 |
# current Bash shell. But it won't be available next time you log in. |
17 |
# |
18 |
# Installing |
19 |
# ========== |
20 |
# |
21 |
# To install this, point to this file from your .bash_profile, like so: |
22 |
# |
23 |
# . ~/path/to/synnefo_bash_completion |
24 |
# |
25 |
# Do the same in your .bashrc if .bashrc doesn't invoke .bash_profile. |
26 |
# |
27 |
# Settings will take effect the next time you log in. |
28 |
# |
29 |
# Uninstalling |
30 |
# ============ |
31 |
# |
32 |
# To uninstall, just remove the line from your .bash_profile and .bashrc. |
33 |
|
34 |
_synnefo_completion() |
35 |
{ |
36 |
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \ |
37 |
COMP_CWORD=$COMP_CWORD \ |
38 |
DJANGO_AUTO_COMPLETE=1 $1 ) ) |
39 |
} |
40 |
complete -F _synnefo_completion -o default snf-manage |
41 |
|