Bash completion support for Compass.
The easiest way (but not necessarily the cleanest) is to copy it somewhere
(e.g. ~/.compass-completion.sh
) and put the following line in your .bashrc
:
source ~/.compass-completion.sh
Otherwise, the most comprehensive methodology is as follows:
-
If you have not already done:
-
Create the directory
~/bash_completion.d
. -
Put the following lines in your
.bashrc
to enable the bash completion:
-
export USER_BASH_COMPLETION_DIR=~/bash_completion.d if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi
*Note:* the bash_completion script can be at a different location depending on your system, like:
* `/etc/bash_completion` (debian like)
* `/usr/local/etc/bash_completion` (BSD like)
* `/opt/local/etc/bash_completion` (macports)
-
Put in the
~/.bash_completion
file the following code:
# source user completion directory definitions
if [[ -d $USER_BASH_COMPLETION_DIR && -r $USER_BASH_COMPLETION_DIR &&
-x
&& -f $i && -r $i ]] && . "$i"
done
fi
unset i
- Copy the
compass-completion.sh
file in your ~/bash_completion.d (e.g.~/bash_completion.d/compass
). - Reload your shell.
Copyright (c) 2011 Mehdi Kabab
Released under MIT License.