[PATCH] D34594: [GSoC] Delete space after flags which has '=' prefix
Yuka Takahashi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 24 08:59:20 PDT 2017
yamaguchi updated this revision to Diff 103842.
yamaguchi added a comment.
Update diff.
https://reviews.llvm.org/D34594
Files:
clang/utils/bash-autocomplete.sh
Index: clang/utils/bash-autocomplete.sh
===================================================================
--- clang/utils/bash-autocomplete.sh
+++ clang/utils/bash-autocomplete.sh
@@ -22,16 +22,17 @@
elif [[ "$w2" == -* && "$w1" == '=' ]]; then
# -foo=bar<tab>
arg="$w2=,$cur"
- else
- _filedir
fi
local flags=$( clang --autocomplete="$arg" )
- if [[ "$cur" == "=" ]]; then
+ if [[ "$cur" == '=' ]]; then
COMPREPLY=( $( compgen -W "$flags" -- "") )
- elif [[ "$flags" == "" ]]; then
+ elif [[ "$flags" == "" || "$arg" == "" ]]; then
_filedir
else
+ # Bash automatically appends a space after '=' by default.
+ # Disable it so that it works nicely for options in the form of -foo=bar.
+ [[ "${flags: -1}" == '=' ]] && compopt -o nospace
COMPREPLY=( $( compgen -W "$flags" -- "$cur" ) )
fi
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34594.103842.patch
Type: text/x-patch
Size: 852 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170624/e2063660/attachment.bin>
More information about the llvm-commits
mailing list