[llvm-branch-commits] [cfe-branch] r309435 - Merging r309112:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jul 28 14:25:21 PDT 2017


Author: hans
Date: Fri Jul 28 14:25:21 2017
New Revision: 309435

URL: http://llvm.org/viewvc/llvm-project?rev=309435&view=rev
Log:
Merging r309112:
------------------------------------------------------------------------
r309112 | yamaguchi | 2017-07-26 06:30:36 -0700 (Wed, 26 Jul 2017) | 7 lines

[Bash-completion] Fixed a bug that file doesn't autocompleted after =

Summary:
File path wasn't autocompleted after `-fmodule-cache-path=[tab]`, so
fixed this bug by checking if $flags contains only a newline or not.

Differential Revision: https://reviews.llvm.org/D35763
------------------------------------------------------------------------

Modified:
    cfe/branches/release_50/   (props changed)
    cfe/branches/release_50/utils/bash-autocomplete.sh

Propchange: cfe/branches/release_50/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 28 14:25:21 2017
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:308455,308824,308897,309058,309226,309327
+/cfe/trunk:308455,308824,308897,309058,309112,309226,309327
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_50/utils/bash-autocomplete.sh
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/utils/bash-autocomplete.sh?rev=309435&r1=309434&r2=309435&view=diff
==============================================================================
--- cfe/branches/release_50/utils/bash-autocomplete.sh (original)
+++ cfe/branches/release_50/utils/bash-autocomplete.sh Fri Jul 28 14:25:21 2017
@@ -65,10 +65,14 @@ _clang()
     return
   fi
 
-  if [[ "$cur" == '=' ]]; then
-    COMPREPLY=( $( compgen -W "$flags" -- "") )
-  elif [[ "$flags" == "" || "$arg" == "" ]]; then
+  # When clang does not emit any possible autocompletion, or user pushed tab after " ",
+  # just autocomplete files.
+  if [[ "$flags" == "$(echo -e '\n')" || "$arg" == "" ]]; then
+    # If -foo=<tab> and there was no possible values, autocomplete files.
+    [[ "$cur" == '=' || "$cur" == -*= ]] && cur=""
     _clang_filedir
+  elif [[ "$cur" == '=' ]]; then
+    COMPREPLY=( $( compgen -W "$flags" -- "") )
   else
     # Bash automatically appends a space after '=' by default.
     # Disable it so that it works nicely for options in the form of -foo=bar.




More information about the llvm-branch-commits mailing list