diff options
author | Mike Crute <mcrute@gmail.com> | 2016-05-11 20:06:30 -0700 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2016-05-11 20:06:30 -0700 |
commit | 1d5f0e6fba9ac8cf094c53daf2621d694bee5c13 (patch) | |
tree | 41ee16855c403f5e4b65cbb35ec9cb3451c24d58 /.bash_completion.d | |
parent | 7f7957f82b344cb813ab78ddd61910a207802cce (diff) | |
download | dotfiles-1d5f0e6fba9ac8cf094c53daf2621d694bee5c13.tar.bz2 dotfiles-1d5f0e6fba9ac8cf094c53daf2621d694bee5c13.tar.xz dotfiles-1d5f0e6fba9ac8cf094c53daf2621d694bee5c13.zip |
Spring cleaning
Diffstat (limited to '.bash_completion.d')
-rw-r--r-- | .bash_completion.d/django_bash_completion.bash | 72 | ||||
-rw-r--r-- | .bash_completion.d/projector-sh.bash | 12 |
2 files changed, 0 insertions, 84 deletions
diff --git a/.bash_completion.d/django_bash_completion.bash b/.bash_completion.d/django_bash_completion.bash deleted file mode 100644 index 1c3887e..0000000 --- a/.bash_completion.d/django_bash_completion.bash +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
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/django_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/django_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 | _django_completion() | ||
35 | { | ||
36 | COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \ | ||
37 | COMP_CWORD=$COMP_CWORD \ | ||
38 | DJANGO_AUTO_COMPLETE=1 $1 ) ) | ||
39 | } | ||
40 | complete -F _django_completion -o default django-admin.py manage.py django-admin | ||
41 | |||
42 | _python_django_completion() | ||
43 | { | ||
44 | if [[ ${COMP_CWORD} -ge 2 ]]; then | ||
45 | PYTHON_EXE=$( basename -- ${COMP_WORDS[0]} ) | ||
46 | echo $PYTHON_EXE | egrep "python([2-9]\.[0-9])?" >/dev/null 2>&1 | ||
47 | if [[ $? == 0 ]]; then | ||
48 | PYTHON_SCRIPT=$( basename -- ${COMP_WORDS[1]} ) | ||
49 | echo $PYTHON_SCRIPT | egrep "manage\.py|django-admin(\.py)?" >/dev/null 2>&1 | ||
50 | if [[ $? == 0 ]]; then | ||
51 | COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]:1}" \ | ||
52 | COMP_CWORD=$(( COMP_CWORD-1 )) \ | ||
53 | DJANGO_AUTO_COMPLETE=1 ${COMP_WORDS[*]} ) ) | ||
54 | fi | ||
55 | fi | ||
56 | fi | ||
57 | } | ||
58 | |||
59 | # Support for multiple interpreters. | ||
60 | unset pythons | ||
61 | if command -v whereis &>/dev/null; then | ||
62 | python_interpreters=$(whereis python | cut -d " " -f 2-) | ||
63 | for python in $python_interpreters; do | ||
64 | pythons="${pythons} $(basename -- $python)" | ||
65 | done | ||
66 | pythons=$(echo $pythons | tr " " "\n" | sort -u | tr "\n" " ") | ||
67 | else | ||
68 | pythons=python | ||
69 | fi | ||
70 | |||
71 | complete -F _python_django_completion -o default $pythons | ||
72 | |||
diff --git a/.bash_completion.d/projector-sh.bash b/.bash_completion.d/projector-sh.bash deleted file mode 100644 index b25985e..0000000 --- a/.bash_completion.d/projector-sh.bash +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #!bash | ||
2 | |||
3 | if [[ -x ~/bin/projector.sh ]]; then | ||
4 | function projector_complete | ||
5 | { | ||
6 | word=${COMP_WORDS[COMP_CWORD]} | ||
7 | allwords="$(~/bin/projector.sh --targets)" | ||
8 | COMPREPLY=( $(compgen -W "$allwords" $word) ) | ||
9 | } | ||
10 | |||
11 | complete -F projector_complete projector.sh | ||
12 | fi | ||