# #########################################################################
# This bash script adds tab-completion feature to cw* cli tools
#
# Testing it out without installing
# =================================
#
# To test out the completion without "installing" this, just run this file
# directly, like so:
#
#     source ~/path/to/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/cwclientlib/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.

if hash register-python-argcomplete 2>/dev/null; then
    for cmd in cwshell cwshell3 cwrql cwrql3 cwget cwget3; do
	if hash $cmd 2>/dev/null; then
	    eval "$(register-python-argcomplete $cmd)"
	fi
    done
fi
