Statistics
| Branch: | Tag: | Revision:

root / snf-webproject / extras / snf_manage_bash_completion @ 4319c408

History | View | Annotate | Download (1.2 kB)

1
# #########################################################################
2
# This bash script adds tab-completion feature to snf-manage
3
#
4
# Testing it out without installing
5
# =================================
6
#
7
# To test out the completion without "installing" this, just run this file
8
# directly, like so:
9
#
10
#     . ~/path/to/snf_manage_bash_completion
11
#
12
# Note: There's a dot ('.') at the beginning of that command.
13
#
14
# After you do that, tab completion will immediately be made available in your
15
# current Bash shell. But it won't be available next time you log in.
16
#
17
# Installing
18
# ==========
19
#
20
# To install this, point to this file from your .bash_profile, like so:
21
#
22
#     . ~/path/to/snf_manage_bash_completion
23
#
24
# Do the same in your .bashrc if .bashrc doesn't invoke .bash_profile.
25
#
26
# Settings will take effect the next time you log in.
27
#
28
# Uninstalling
29
# ============
30
#
31
# To uninstall, just remove the line from your .bash_profile and .bashrc.
32

    
33
_synnefo_completion()
34
{
35
    COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
36
                   COMP_CWORD=$COMP_CWORD \
37
	               DJANGO_AUTO_COMPLETE=1 $1 ) )
38
}
39
complete -F _synnefo_completion -o default snf-manage
40