New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bash completion for `docker-machine mount` #4300

merged 1 commit into from Nov 14, 2017


None yet
3 participants

albers commented Nov 1, 2017

This adds bash completion for #4018.

Bash completion supports completion for files and directory with its builtin _filedir function. Sadly, this only works for local files and directories. I don't know a simple way to do remote file system completions. So the first argument is just completed to the machine name and a trailing :. The user will have to add the remote path without support. The second argument is completed to local directories.

I added a helper function _docker_machine_pos_first_nonflag that allows to distinguish between the remote and local path arguments and to suppress completion for further arguments (which would be syntax errors).
This function was copied from Docker's bash completion.

Add bash completion for `docker-machine mount`
Signed-off-by: Harald Albers <>

This comment has been minimized.

Show comment
Hide comment

dgageot Nov 14, 2017




dgageot commented Nov 14, 2017


@dgageot dgageot merged commit 6f12672 into docker:master Nov 14, 2017

4 checks passed

ci/circleci Your tests passed on CircleCI!
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
dco-signed All commits are signed

@albers albers deleted the albers:completion-mount branch Nov 14, 2017

@shin- shin- added this to the 0.14.0 milestone Feb 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment