yamaguchi created this revision.

Bash-autocompletion for clang depends on bash-completion system and abort `bash:
_init_completion: command not found` when it is not installed.

Changed to return silently if bash-completion is not installed.


https://reviews.llvm.org/D34924

Files:
  clang/utils/bash-autocomplete.sh


Index: clang/utils/bash-autocomplete.sh
===================================================================
--- clang/utils/bash-autocomplete.sh
+++ clang/utils/bash-autocomplete.sh
@@ -2,6 +2,11 @@
 _clang()
 {
   local cur prev words cword arg flags
+  # Require bash-completion with _init_completion
+  _init_completion 2>/dev/null
+  if [[ "$?" != 0 ]]; then
+    return
+  fi
   _init_completion -n : || return
 
   # bash always separates '=' as a token even if there's no space before/after 
'='.


Index: clang/utils/bash-autocomplete.sh
===================================================================
--- clang/utils/bash-autocomplete.sh
+++ clang/utils/bash-autocomplete.sh
@@ -2,6 +2,11 @@
 _clang()
 {
   local cur prev words cword arg flags
+  # Require bash-completion with _init_completion
+  _init_completion 2>/dev/null
+  if [[ "$?" != 0 ]]; then
+    return
+  fi
   _init_completion -n : || return
 
   # bash always separates '=' as a token even if there's no space before/after '='.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to