[PATCH] D33237: [GSoC] Shell autocompletion for clang

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 09:54:02 PDT 2017


ruiu added inline comments.


================
Comment at: clang/utils/bash-autocomplete.sh:6-10
+    flags=$( clang --autocomplete="$cur" )
+    if [[ "$flags" == "" || "$cur" == "" ]]; then
+        _filedir
+    else
+        COMPREPLY=( $( compgen -W "$flags" -- "$cur") )
----------------
s/cur"/cur" / for consistency. Or s/$( /$(/ if you prefer, but `$( foo)` looks odd.



================
Comment at: clang/utils/bash-autocomplete.sh:12
+    fi
+
+} &&
----------------
Remove blank line.


================
Comment at: clang/utils/bash-autocomplete.sh:13-14
+
+} &&
+    complete -F _clang clang
----------------
What is the meaning of `&&` here? It seems you can remove it.


================
Comment at: llvm/lib/Option/OptTable.cpp:195
+    for (int I = 0; In.Prefixes[I]; I++) {
+      std::string S = (std::string(In.Prefixes[I]) + std::string(In.Name));
+      if (StringRef(S).startswith(Cur))
----------------
Remove unnecessary ().


https://reviews.llvm.org/D33237





More information about the llvm-commits mailing list