summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/bash-autocomplete.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/utils/bash-autocomplete.sh b/utils/bash-autocomplete.sh
new file mode 100644
index 0000000000..a906712514
--- /dev/null
+++ b/utils/bash-autocomplete.sh
@@ -0,0 +1,14 @@
+# 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