Merge pull request #730 from BretFisher/729-fix-zsh-node-and-stack-names

Fixing zsh column finding in nodes and stacks.
This commit is contained in:
Sebastiaan van Stijn 2017-12-06 16:03:20 -08:00 committed by GitHub
commit 143f9f0336
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1394,7 +1394,7 @@ __docker_nodes() {
# Names # Names
if [[ $type = (names|all) ]]; then if [[ $type = (names|all) ]]; then
for line in $lines; do for line in $lines; do
s="${line[${begin[NAME]},${end[NAME]}]%% ##}" s="${line[${begin[HOSTNAME]},${end[HOSTNAME]}]%% ##}"
nodes=($nodes $s) nodes=($nodes $s)
done done
fi fi
@ -2170,9 +2170,9 @@ __docker_stacks() {
end[${header[$i,$((j-1))]}]=-1 end[${header[$i,$((j-1))]}]=-1
lines=(${lines[2,-1]}) lines=(${lines[2,-1]})
# Service ID # Service NAME
for line in $lines; do for line in $lines; do
s="${line[${begin[ID]},${end[ID]}]%% ##}" s="${line[${begin[NAME]},${end[NAME]}]%% ##}"
stacks=($stacks $s) stacks=($stacks $s)
done done