Don't use extglob in bash/docker-machine.bash#4141
Conversation
|
Please sign your commits following these rules: $ git clone -b "extglob" git@github.com:Empact/machine.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -fAmending updates the existing PR. You DO NOT need to open a new one. |
extglob is not needed here - the only call is: _docker_machine_map_key_of_current_option '--filter' So $glob is always '--filter', so there isn't every a pattern-list to match. According to my testing completion for docker-machine ls --filter completion works for both driver and state Fixes docker-archive-public#4126 Introduced in fd9a0a6 Signed-off-by: Ben Woosley <ben.woosley@gmail.com>
|
cc @albers |
|
Thanks for the ping. I'll take a look at it.
|
|
Ah, Mac OS again with its ancient bash. @Empact You're right: no extglob is needed here, so it's probably best to keep the code simple. Thanks very much for fixing this. To verify without a Mac: $ docker run --rm --volume $(pwd)/contrib/completion/bash/docker-machine.bash:/docker-completion albers/bash-completion-mac bash -c ". /docker-completion" && echo OK
/docker-completion: line 86: syntax error in conditional expression: unexpected token `('
/docker-completion: line 86: syntax error near `@($'
/docker-completion: line 86: ` [[ ${words[$glob_pos]} == @($glob) ]] && echo "$key"'With the fix it loads properly: $ docker run --rm --volume $(pwd)/contrib/completion/bash/docker-machine.bash:/docker-completion albers/bash-completion-mac bash -c ". /docker-completion" && echo OK
OKLGTM @shin- This is a bugfix and should go into 1.12.0. |
|
Would it be reasonable to test against |
|
@jakirkham I'm working on this. Similar to docker/cli#266, a test like |
|
Thank you both! |
extglob is not needed here - the only call is:
_docker_machine_map_key_of_current_option '--filter'
So $glob is always '--filter', so there isn't every a pattern-list to match.
According to my testing completion for docker-machine
ls --filter completion works for both driver and state
Fixes #4126
Introduced in fd9a0a6