From e81c1ec00fd6632b90ba708240d46605896989a0 Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Fri, 5 Aug 2016 13:55:03 +0400 Subject: [PATCH] Delete _docker-machine Upstream has own version of completions: https://github.com/docker/machine/blob/master/contrib/completion/zsh/_docker-machine. It is provided in the latest release (0.8.0) at least. --- src/_docker-machine | 362 -------------------------------------------- 1 file changed, 362 deletions(-) delete mode 100644 src/_docker-machine diff --git a/src/_docker-machine b/src/_docker-machine deleted file mode 100644 index 96ebb90..0000000 --- a/src/_docker-machine +++ /dev/null @@ -1,362 +0,0 @@ -#compdef docker-machine -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Docker Machine (http://docs.docker.com/machine/). -# Adapted from boot2docker completion by hhatto (https://github.com/hhatto) -# and docker completion by @aeonazaan and @bobmaerten. -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * ilkka (https://github.com/ilkka) -# -# ------------------------------------------------------------------------------ - -# helper function for completing available machines -__machines() { - declare -a machines_cmd - machines_cmd=($(docker-machine ls|tail -n +2|awk '{print $1":"$3"("$4")"}')) - _describe 'machines' machines_cmd -} - -# subcommands -local -a _docker_machine_cmds - -_docker_machine_cmds=( - 'active:Get or set the active 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' \ - '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' -) - -# subcommand completion functions -__active() { - __machines -} - -__help() { - _values 'Get help for subcommand' \ - 'active' \ - 'config' \ - 'create' \ - 'env' \ - 'inspect' \ - 'ip' \ - 'kill' \ - 'ls' \ - 'provision' \ - 'regenerate-certs' \ - 'restart' \ - 'rm' \ - 'ssh' \ - 'scp' \ - 'start' \ - 'status' \ - 'stop' \ - 'upgrade' \ - 'url' \ - 'version' \ - 'help' -} - -__create() { - _arguments \ - '--amazonec2-access-key:AWS Access Key:()' \ - '--amazonec2-ami:AWS machine image:()' \ - '--amazonec2-instance-type:AWS instance type:()' \ - '--amazonec2-region:AWS region:()' \ - '--amazonec2-root-size:AWS root disk size (in GB):()' \ - '--amazonec2-secret-key:AWS Secret Key:()' \ - '--amazonec2-security-group:AWS VPC security group:()' \ - '--amazonec2-session-token:AWS Session Token:()' \ - '--amazonec2-subnet-id:AWS VPC subnet id:()' \ - '--amazonec2-vpc-id:AWS VPC id:()' \ - '--amazonec2-zone:AWS zone for instance (i.e. a,b,c,d,e):()' \ - '--azure-docker-port:Azure Docker port:()' \ - '--azure-image:Azure image name. Default is Ubuntu 14.04 LTS x64:()' \ - '--azure-location:Azure location:()' \ - '--azure-password:Azure user password:()' \ - '--azure-publish-settings-file:Azure publish settings file:()' \ - '--azure-size:Azure size:()' \ - '--azure-ssh-port:Azure SSH port:()' \ - '--azure-subscription-cert:Azure subscription cert:()' \ - '--azure-subscription-id:Azure subscription ID:()' \ - '--azure-username:Azure username:()' \ - '--digitalocean-access-token:Digital Ocean access token:()' \ - '--digitalocean-image:Digital Ocean Image:()' \ - '--digitalocean-region:Digital Ocean region:()' \ - '--digitalocean-size:Digital Ocean size:()' \ - '--google-disk-size:GCE Instance Disk Size (in GB):()' \ - '--google-machine-type:GCE Machine Type:()' \ - '--google-project:GCE Project:()' \ - '--google-scopes:GCE Scopes (comma-separated if multiple scopes):()' \ - '--google-username:GCE User Name:()' \ - '--google-zone:GCE Zone:()' \ - '--openstack-auth-url:OpenStack authentication URL:()' \ - '--openstack-endpoint-type:OpenStack endpoint type (adminURL, internalURL or publicURL):()' \ - '--openstack-flavor-id:OpenStack flavor id to use for the instance:()' \ - '--openstack-flavor-name:OpenStack flavor name to use for the instance:()' \ - '--openstack-floatingip-pool:OpenStack floating IP pool to get an IP from to assign to the instance:()' \ - '--openstack-image-id:OpenStack image id to use for the instance:()' \ - '--openstack-image-name:OpenStack image name to use for the instance:()' \ - '--openstack-net-id:OpenStack image name to use for the instance:()' \ - '--openstack-net-name:OpenStack network name the machine will be connected on:()' \ - '--openstack-password:OpenStack password:()' \ - '--openstack-region:OpenStack region name:()' \ - '--openstack-sec-groups:OpenStack comma separated security groups for the machine:()' \ - '--openstack-ssh-port:OpenStack SSH port:()' \ - '--openstack-ssh-user:OpenStack SSH user:()' \ - '--openstack-tenant-id:OpenStack tenant id:()' \ - '--openstack-tenant-name:OpenStack tenant name:()' \ - '--openstack-username:OpenStack username:()' \ - '--rackspace-api-key:Rackspace API key:()' \ - '--rackspace-docker-install:Set if docker have to be installed on the machine:()' \ - '--rackspace-endpoint-type:Rackspace endpoint type (adminURL, internalURL or the default publicURL):()' \ - '--rackspace-flavor-id:Rackspace flavor ID. Default: General Purpose 1GB:()' \ - '--rackspace-image-id:Rackspace image ID. Default: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM):()' \ - '--rackspace-region:Rackspace region name:()' \ - '--rackspace-ssh-port:SSH port for the newly booted machine. Set to 22 by default:()' \ - '--rackspace-ssh-user:SSH user for the newly booted machine. Set to root by default:()' \ - '--rackspace-username:Rackspace account username:()' \ - '--softlayer-api-endpoint:softlayer api endpoint to use:()' \ - '--softlayer-api-key:softlayer user API key:()' \ - "--softlayer-cpu:number of CPUs for the machine:()" \ - '--softlayer-disk-size:Disk size for machine, a value of 0 uses the default size on softlayer:()' \ - '--softlayer-domain:domain name for machine:()' \ - '--softlayer-hostname:hostname for the machine:()' \ - '--softlayer-hourly-billing:set hourly billing for machine - on by default:()' \ - '--softlayer-image:OS image for machine:()' \ - '--softlayer-local-disk:use machine local disk instead of softlayer SAN:()' \ - '--softlayer-memory:Memory in MB for machine:()' \ - '--softlayer-private-net-only:Use only private networking:()' \ - '--softlayer-region:softlayer region for machine:()' \ - '--softlayer-user:softlayer user account name:()' \ - '--url:URL of host when no driver is selected:()' \ - '--virtualbox-boot2docker-url:The URL of the boot2docker image. Defaults to the latest available version:()' \ - '--virtualbox-disk-size:Size of disk for host in MB:()' \ - '--virtualbox-memory:Size of memory for host in MB:()' \ - '--vmwarefusion-boot2docker-url:Fusion URL for boot2docker image:()' \ - '--vmwarefusion-disk-size:Fusion size of disk for host VM (in MB):()' \ - '--vmwarefusion-memory-size:Fusion size of memory for host VM (in MB):()' \ - '--vmwarevcloudair-catalog:vCloud Air Catalog (default is Public Catalog):()' \ - '--vmwarevcloudair-catalogitem:vCloud Air Catalog Item (default is Ubuntu Precise):()' \ - '--vmwarevcloudair-computeid:vCloud Air Compute ID (if using Dedicated Cloud):()' \ - '--vmwarevcloudair-cpu-count:vCloud Air VM Cpu Count (default 1):()' \ - '--vmwarevcloudair-docker-port:vCloud Air Docker port:()' \ - '--vmwarevcloudair-edgegateway:vCloud Air Org Edge Gateway (Default is ):()' \ - '--vmwarevcloudair-memory-size:vCloud Air VM Memory Size in MB (default 2048):()' \ - '--vmwarevcloudair-orgvdcnetwork:vCloud Air Org VDC Network (Default is -default-routed):()' \ - '--vmwarevcloudair-password:vCloud Air password:()' \ - '--vmwarevcloudair-provision:vCloud Air Install Docker binaries (default is true):()' \ - '--vmwarevcloudair-publicip:vCloud Air Org Public IP to use:()' \ - '--vmwarevcloudair-ssh-port:vCloud Air SSH port:()' \ - '--vmwarevcloudair-username:vCloud Air username:()' \ - '--vmwarevcloudair-vdcid:vCloud Air VDC ID:()' \ - '--vmwarevsphere-boot2docker-url:vSphere URL for boot2docker image:()' \ - '--vmwarevsphere-compute-ip:vSphere compute host IP where the docker VM will be instantiated:()' \ - '--vmwarevsphere-cpu-count:vSphere CPU number for docker VM:()' \ - '--vmwarevsphere-datacenter:vSphere datacenter for docker VM:()' \ - '--vmwarevsphere-datastore:vSphere datastore for docker VM:()' \ - '--vmwarevsphere-disk-size:vSphere size of disk for docker VM (in MB):()' \ - '--vmwarevsphere-memory-size:vSphere size of memory for docker VM (in MB):()' \ - '--vmwarevsphere-network:vSphere network where the docker VM will be attached:()' \ - '--vmwarevsphere-password:vSphere password:()' \ - '--vmwarevsphere-pool:vSphere resource pool for docker VM:()' \ - '--vmwarevsphere-username:vSphere username:()' \ - '--vmwarevsphere-vcenter:vSphere IP/hostname for vCenter:()' \ - '--driver:Driver to create machine with.:(amazonec2 azure digitalocean google none openstack rackspace softlayer virtualbox vmwarefusion vmwarevcloudair vmwarevsphere)' \ - '--swarm:Configure Machine with Swarm:()' \ - '--swarm-master:Configure Machine to be a Swarm master:()' \ - '--swarm-discovery:Discovery service to use with Swarm:()' \ - '--swarm-host:ip/socket to listen on for Swarm master:()' \ - '--swarm-addr:addr to advertise for Swarm (default: detect and use the machine IP):()' -} - -__config() { - _arguments \ - '--swarm[Display the Swarm config instead of the Docker daemon]' - __machines -} - -__inspect() { - __machines -} - -__ip() { - __machines -} - -__env() { - _arguments \ - '--unset[Unset variables instead of setting them]' \ - '--swarm[Display the Swarm config instead of the Docker daemon]' - __machines -} - -__kill() { - __machines -} - -__ls() { - _arguments \ - '--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 -} - -__rm() { - __machines -} - -__ssh() { - __machines -} - -__upgrade() { - __machines -} - -__url() { - __machines -} - -__version() { - __machines -} - -# common args -_arguments \ - '--debug[Enable debug mode]' \ - '--storage-path[Configures storage path]:_files' \ - '--tls-ca-cert[CA to verify remotes against]:_files' \ - '--tls-ca-key[Private key to generate certificates]:_files' \ - '--tls-client-cert[Client cert to use for TLS]:_files' \ - '--tls-client-key[Private key used in client TLS auth]:_files' \ - '--help[show help]' \ - '--version[print the version]' \ - '*:: :->command' - -# start machines! -if (( CURRENT == 1 )); then - _describe -t commands 'docker-machine command' _docker_machine_cmds -fi - -local -a _command_args -case "$words[1]" in - active) - __active ;; - config) - __config ;; - create) - __create ;; - env) - __env ;; - inspect) - __inspect ;; - ip) - __ip ;; - kill) - __kill ;; - ls) - __ls ;; - provision) - __provision ;; - regenerate-certs) - __regenerate-certs ;; - restart) - __restart ;; - rm) - __rm ;; - ssh) - __ssh ;; - scp) - __scp ;; - start) - __start ;; - status) - __status ;; - stop) - __stop ;; - upgrade) - __upgrade ;; - url) - __url ;; - help) - __help ;; -esac