[PATCH] D34924: [Bash-autocompletion] Add support for older bash version.

Rui Ueyama via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 1 05:30:42 PDT 2017


ruiu added inline comments.


================
Comment at: clang/utils/bash-autocomplete.sh:3
+
+_clang_filedir()
+{
----------------
yamaguchi wrote:
> ruiu wrote:
> > Is the output of `compgen -f` the same as `_filedir`? If so, can you always use `compgen -f`?
> _filedir is better than `compgen -f`, because it honors spaces in filenames.
You want to describe it in a comment: _filedir function provided by recent versions of bash-completion package is better than "compgen -f" because the former honors spaces in pathnames while the latter doesn't. So we use compgen only when _filedir is not provided.


================
Comment at: clang/utils/bash-autocomplete.sh:17-18
+  if [[ "$?" != 0 ]]; then
+    COMPREPLY=()
+    _get_comp_words_by_ref cur prev words cword
+  fi
----------------
It's not clear what this code does. Can you explain?


https://reviews.llvm.org/D34924





More information about the cfe-commits mailing list