[PATCH] D34927: [Bash-autocompletion] Fix a bug that -foo=bar doesn't handled properly
Yuka Takahashi via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 4 19:17:01 PDT 2017
yamaguchi updated this revision to Diff 105208.
yamaguchi added a comment.
Update diff.
Thanks for the pointing out.
https://reviews.llvm.org/D34927
Files:
clang/utils/bash-autocomplete.sh
Index: clang/utils/bash-autocomplete.sh
===================================================================
--- clang/utils/bash-autocomplete.sh
+++ clang/utils/bash-autocomplete.sh
@@ -34,12 +34,18 @@
elif [[ "$w1" == -* && "$cur" == '=' ]]; then
# -foo=<tab>
arg="$w1=,"
+ elif [[ "$cur" == -*= ]]; then
+ # -foo=<tab>
+ arg="$cur,"
elif [[ "$w1" == -* ]]; then
# -foo <tab> or -foo bar<tab>
arg="$w1,$cur"
elif [[ "$w2" == -* && "$w1" == '=' ]]; then
# -foo=bar<tab>
arg="$w2=,$cur"
+ elif [[ ${cur: -1} != '=' && ${cur/=} != $cur ]]; then
+ # -foo=bar<tab>
+ arg="${cur%=*}=,${cur#*=}"
fi
# expand ~ to $HOME
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34927.105208.patch
Type: text/x-patch
Size: 675 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170705/161b8935/attachment-0001.bin>
More information about the cfe-commits
mailing list