blob: 631d6f2297ca23a846be2a5acfd881d57c59a1d3 [file] [log] [blame]
# #########################################################################
# This bash script adds tab-completion to buck.
#
# Testing it out without installing
# =================================
#
# To test out the completion without "installing" this, just run this file
# directly, like so:
#
# . ~/path/to/bash_completion
#
# Note: There's a dot ('.') at the beginning of that command.
#
# After you do that, tab completion will immediately be made available in your
# current Bash shell. It will not, however, be available next time you log in.
#
# Installing
# ==========
#
# To install the completion, copy this file to the appropriate folder for
# your distribution, for example:
#
# cp ~/path/to/bash_completion /etc/bash_completion.d/buck
#
# Alternatively you can invoke this file from your .bash_profile, like so:
#
# . ~/path/to/bash_completion
#
# Do the same in your .bashrc if .bashrc doesn't invoke .bash_profile.
#
# The settings will take effect the next time you log in.
#
# Uninstalling
# ============
#
# To uninstall, just remove the line from your .bash_profile and .bashrc.
# #########################################################################
_buck_sh()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="audit build cache clean install project targets test uninstall"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
}
complete -F _buck_sh buck