Skip to content

Commit 7b943bc

Browse files
committed
Auto merge of #6038 - ehuss:bashcomp, r=alexcrichton
Minor updates to bash completion - Fix bash completion on mac. - Support arbitrary toolchain names.
2 parents 010710b + 3ae7f03 commit 7b943bc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/etc/cargo.bashcomp.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ __cargo_commands=$(cargo --list 2>/dev/null | tail -n +2)
125125
_locate_manifest(){
126126
local manifest=`cargo locate-project 2>/dev/null`
127127
# regexp-replace manifest '\{"root":"|"\}' ''
128-
echo ${manifest:9:-2}
128+
echo ${manifest:9:${#manifest}-11}
129129
}
130130

131131
# Extracts the values of "name" from the array given in $1 and shows them as
@@ -238,6 +238,8 @@ _toolchains(){
238238
result+=("+${BASH_REMATCH[1]}-${BASH_REMATCH[3]}")
239239
fi
240240
result+=("+$line")
241+
else
242+
result+=("+$line")
241243
fi
242244
done <<< "$toolchains"
243245
echo "${result[@]}"

0 commit comments

Comments
 (0)