This revision was automatically updated to reflect the committed changes.
Closed by commit rL307478: [Bash-autocompletion] Fix a bug that -foo=bar
doesn't handled properly (authored by yamaguchi).
Changed prior to commit:
https://reviews.llvm.org/D34927?vs=105208&id=105771#toc
Repository:
rL LLVM
https://reviews.llvm.org/D34927
Files:
cfe/trunk/utils/bash-autocomplete.sh
Index: cfe/trunk/utils/bash-autocomplete.sh
===================================================================
--- cfe/trunk/utils/bash-autocomplete.sh
+++ cfe/trunk/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
Index: cfe/trunk/utils/bash-autocomplete.sh
===================================================================
--- cfe/trunk/utils/bash-autocomplete.sh
+++ cfe/trunk/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
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits