mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-20 03:55:48 -04:00

Summary: This is a first patch for GSoC project, bash-completion for clang. To use this on bash, please run `source clang/utils/bash-autocomplete.sh`. bash-autocomplete.sh is code for bash-completion. Simple flag completion and path completion is available in this patch. Reviewers: teemperor, v.g.vassilev, ruiu, Bigcheese, efriedma Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33237 llvm-svn: 303670
15 lines
357 B
Bash
15 lines
357 B
Bash
# Please add "source /path/to/bash-autocomplete.sh" to your .bashrc to use this.
|
|
_clang()
|
|
{
|
|
local cur prev words cword flags
|
|
_init_completion -n : || return
|
|
|
|
flags=$( clang --autocomplete="$cur" )
|
|
if [[ "$flags" == "" || "$cur" == "" ]]; then
|
|
_filedir
|
|
else
|
|
COMPREPLY=( $( compgen -W "$flags" -- "$cur" ) )
|
|
fi
|
|
}
|
|
complete -F _clang clang
|