2
0
mirror of https://github.com/kazhala/dotbare synced 2024-11-04 06:00:45 +00:00

fix(completion): bash completion broken awk command

This commit is contained in:
Kevin Zhuang 2020-07-15 12:27:54 +10:00
parent 2c49e6de67
commit 0a81217772

View File

@ -47,14 +47,11 @@ __dotbare_completion()
return
elif [[ "${prev}" != "-h" && "${prev}" != "--help" ]]; then
selected=("${COMP_WORDS[@]:1}")
options=$(
"${mydir}"/dotbare "${COMP_WORDS[1]}" -h \
| awk -v selected="${selected[*]}" '{
| awk '{
gsub(/,/, " ", $0)
if (selected ~ $1) {
next
} else if ($0 ~ /^ -p PATH/) {
if ($0 ~ /^ -p PATH/) {
gsub(/^ -p PATH --path PATH/, "-p", $0)
gsub(/\t/, " ", $0)
print $0