Skip to content

Commit

Permalink
Merge pull request #410 from dserodio/docker-machine
Browse files Browse the repository at this point in the history
Added all docker-machine commands as of 0.6.0
  • Loading branch information
nicoulaj committed Apr 26, 2016
2 parents f60d445 + af88651 commit 17743e1
Showing 1 changed file with 51 additions and 8 deletions.
59 changes: 51 additions & 8 deletions src/_docker-machine
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,25 @@ local -a _docker_machine_cmds

_docker_machine_cmds=(
'active:Get or set the active machine' \
'create:Create a machine' \
'config:Print the connection config for machine' \
'create:Create a machine' \
'env:Display the commands to set up the environment for the Docker client' \
'inspect:Inspect information about a machine' \
'ip:Get the IP address of a machine' \
'kill:Kill a machine' \
'ls:List machines' \
'provision:Re-provision existing machines' \
'regenerate-certs:Regenerate TLS Certificates for a machine' \
'restart:Restart a machine' \
'rm:Remove a machine' \
'env:Display the commands to set up the environment for the Docker client' \
'ssh:Log into or run a command on a machine with SSH' \
'scp:Copy files between machines' \
'start:Start a machine' \
'status:Get the status of a machine' \
'stop:Stop a machine' \
'upgrade:Upgrade a machine to the latest version of Docker' \
'url:Get the URL of a machine' \
'version:Show the Docker Machine version or a machine docker version' \
'help:Shows a list of commands or help for one command'
)

Expand All @@ -52,20 +57,25 @@ __active() {
__help() {
_values 'Get help for subcommand' \
'active' \
'create' \
'config' \
'create' \
'env' \
'inspect' \
'ip' \
'kill' \
'ls' \
'provision' \
'regenerate-certs' \
'restart' \
'rm' \
'env' \
'ssh' \
'scp' \
'start' \
'status' \
'stop' \
'upgrade' \
'url' \
'version' \
'help'
}

Expand Down Expand Up @@ -212,14 +222,35 @@ __ls() {
'--quiet[Enable quiet mode]'
}

__provision() {
__machines
}

__regenerate-certs() {
_arguments \
'--force[Force rebuild and do not prompt]'
__machines
}

__restart() {
__machines
}

__scp() {
# This can certainly be improved, but it's a start
_arguments \
'--recursive[Copy files recursively (required to copy directories)]'
__machines
}

__start() {
__machines
}

__status() {
__machines
}

__stop() {
__machines
}
Expand All @@ -240,6 +271,10 @@ __url() {
__machines
}

__version() {
__machines
}

# common args
_arguments \
'--debug[Enable debug mode]' \
Expand All @@ -261,10 +296,12 @@ local -a _command_args
case "$words[1]" in
active)
__active ;;
create)
__create ;;
config)
__config ;;
create)
__create ;;
env)
__env ;;
inspect)
__inspect ;;
ip)
Expand All @@ -273,16 +310,22 @@ case "$words[1]" in
__kill ;;
ls)
__ls ;;
provision)
__provision ;;
regenerate-certs)
__regenerate-certs ;;
restart)
__restart ;;
rm)
__rm ;;
env)
__env ;;
ssh)
__ssh ;;
scp)
__scp ;;
start)
__start ;;
status)
__status ;;
stop)
__stop ;;
upgrade)
Expand Down

0 comments on commit 17743e1

Please sign in to comment.