forked from circus-tent/circus
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
circus-tent#265 - Add autocomplete and bash_completion
- Loading branch information
Showing
2 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# ######################################################################### | ||
# 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 |