diff options
Diffstat (limited to 'plugins/vagrant/_vagrant')
-rw-r--r-- | plugins/vagrant/_vagrant | 55 |
1 files changed, 34 insertions, 21 deletions
diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index 76f80b0d7..79c4c6fe6 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -1,4 +1,4 @@ -#compdef vagrant +#compdef vagrant #autoload # vagrant zsh completion @@ -6,37 +6,50 @@ local -a _1st_arguments _1st_arguments=( 'box:Box commands' - 'connect:Connects to a shared, remote Vagrant environment' + 'cloud:Manages everything related to Vagrant Cloud' + 'connect:Connects to a remotely shared Vagrant environment' 'destroy:Destroys the vagrant environment' - 'docker-logs:Shows Docker logs' - 'docker-run:Run one-off commands against a Docker container' + 'docker-logs:Outputs the logs from the Docker container' + 'docker-run:Run a one-off command in the context of a container' 'global-status:Reports the status of all active Vagrant environments on the system' 'halt:Halts the currently running vagrant environment' + 'help:Shows the help for a subcommand' 'init:[box_name] [box_url] Initializes current folder for Vagrant usage' + 'list-commands:Outputs all available Vagrant subcommands, even non-primary ones' 'login:Authenticates against a Vagrant Cloud server to access protected boxes' 'package:Packages a vagrant environment for distribution' 'plugin:Plugin commands' + 'port:Displays information about guest port mappings' 'provision:Run the provisioner' + 'push:Deploys code in this environment to a configured destination' + 'rdp:Connects to machine via RDP' 'reload:Reload the vagrant environment' - 'resume:Resumes a suspend vagrant environment' - 'share:Shares the Vagrant environment and allows remote access' + 'resume:Resumes a suspended vagrant environment' + 'rsync:Syncs rsync synced folders to remote machine' + 'rsync-auto:Syncs rsync synced folders automatically when files change' + 'share:Shares your Vagrant environment with anyone in the world' + 'snapshot:Manage snapshots with the guest machine' 'ssh:SSH into the currently running environment' - 'ssh-config:outputs .ssh/config valid syntax for connecting to this environment via ssh' + 'ssh-config:Outputs .ssh/config valid syntax for connecting to this environment via ssh' 'status:Shows the status of the current Vagrant environment' 'suspend:Suspends the currently running vagrant environment' + 'snapshot:Used to manage snapshots with the guest machine' 'up:Creates the vagrant environment' - 'version:Prints the currently installed Vagrant version and checks for new updates' + 'validate:Validates the Vagrantfile' + 'version:Prints current and latest Vagrant version' '--help:[TASK] Describe available tasks or one specific task' '--version:Prints the Vagrant version information' ) local -a _box_arguments _box_arguments=( - 'add:NAME URI Add a box to the system' - 'help:COMMAND Describe subcommands or one specific subcommand' + 'add:ADDRESS Adds a box to the system' + 'help:COMMAND List subcommands' 'list:Lists all installed boxes' - 'remove:NAME Remove a box from the system' - 'repackage:NAME Repackage an installed box into a `.box` file.' + 'outdated:Checks if a box has newer version' + 'remove:NAME Removes a box from the system' + 'repackage:NAME PROVIDER VERSION Repackages an installed box into a `.box` file' + 'update:Updates box to a newer version, if available' ) __task_list () @@ -44,7 +57,7 @@ __task_list () local expl declare -a tasks - tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version) + tasks=(box destroy halt init package port provision reload resume ssh ssh_config status suspend up version) _wanted tasks expl 'help' compadd $tasks } @@ -56,8 +69,8 @@ __box_list () __vm_list () { - _wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *[:"]\([a-zA-Z0-9_-]\+\)' 2>/dev/null | awk '{print substr($2, 2)}') - _wanted application expl 'command' compadd $(command ls .vagrant/machines/ 2>/dev/null) + _wanted application expl 'command' compadd $(command grep "${VAGRANT_CWD:-.}/Vagrantfile" -oe '^[^#]*\.vm\.define *[:"]\([a-zA-Z0-9_-]\+\)' 2>/dev/null | awk '{print substr($2, 2)}') + _wanted application expl 'command' compadd $(command ls "${VAGRANT_CWD:-.}/.vagrant/machines/" 2>/dev/null) } __vagrant-box () @@ -71,14 +84,14 @@ __vagrant-box () case $state in (command) - _describe -t commands "gem subcommand" _box_arguments + _describe -t commands "vagrant subcommand" _box_arguments return ;; (options) case $line[1] in (repackage|remove) - _arguments ':feature:__box_list' + _arguments ':feature:__box_list' ;; esac ;; @@ -100,21 +113,21 @@ _arguments -C \ case $state in (command) - _describe -t commands "gem subcommand" _1st_arguments + _describe -t commands "vagrant subcommand" _1st_arguments return ;; (options) case $line[1] in (help) - _arguments ':feature:__task_list' + _arguments ':feature:__task_list' ;; (box) __vagrant-box ;; - (up|provision|package|destroy|reload|ssh|ssh-config|halt|resume|status) - _arguments ':feature:__vm_list' + (up|provision|port|package|destroy|reload|ssh|ssh-config|halt|resume|status) + _arguments ':feature:__vm_list' esac ;; esac |