Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (36 sloc) 1.09 KB
# #########################################################################
# This bash script adds tab-completion feature to circusctl
#
# Testing it out without installing
# =================================
#
# To test out the completion without "installing" this, just run this file
# directly, like so:
#
# source ~/path/to/circusctl_bash_completion
#
# After you do that, tab completion will immediately be made available in your
# current Bash shell. But it won't be available next time you log in.
#
# Installing
# ==========
#
# To install this, point to this file from your .bash_profile, like so:
#
# source ~/path/to/circusctl_bash_completion
#
# Do the same in your .bashrc if .bashrc doesn't invoke .bash_profile.
#
# Settings will take effect the next time you log in.
#
# Uninstalling
# ============
#
# To uninstall, just remove the line from your .bash_profile and .bashrc.
_circusctl_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
COMP_CWORD=$COMP_CWORD \
AUTO_COMPLETE=1 $1 ) )
}
complete -F _circusctl_completion -o default circusctl