| 
									
										
										
										
											2015-08-25 18:07:47 +02:00
										 |  |  | #compdef vagrant | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  | #autoload | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-15 15:18:58 -05:00
										 |  |  | # vagrant zsh completion | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | local -a _1st_arguments | 
					
						
							|  |  |  | _1st_arguments=( | 
					
						
							|  |  |  |     'box:Box commands' | 
					
						
							| 
									
										
										
										
											2018-12-31 14:13:31 -05:00
										 |  |  |     'cloud:Manages everything related to Vagrant Cloud' | 
					
						
							| 
									
										
										
										
											2015-08-25 18:07:47 +02:00
										 |  |  |     'connect:Connects to a remotely shared Vagrant environment' | 
					
						
							| 
									
										
										
										
											2010-11-15 15:18:58 -05:00
										 |  |  |     'destroy:Destroys the vagrant environment' | 
					
						
							| 
									
										
										
										
											2015-08-25 18:07:47 +02:00
										 |  |  |     'docker-logs:Outputs the logs from the Docker container' | 
					
						
							|  |  |  |     'docker-run:Run a one-off command in the context of a container' | 
					
						
							| 
									
										
										
										
											2014-05-15 12:26:39 -07:00
										 |  |  |     'global-status:Reports the status of all active Vagrant environments on the system' | 
					
						
							| 
									
										
										
										
											2010-11-15 15:18:58 -05:00
										 |  |  |     'halt:Halts the currently running vagrant environment' | 
					
						
							| 
									
										
										
										
											2015-08-25 18:07:47 +02:00
										 |  |  |     'help:Shows the help for a subcommand' | 
					
						
							| 
									
										
										
										
											2010-11-15 15:18:58 -05:00
										 |  |  |     'init:[box_name] [box_url] Initializes current folder for Vagrant usage' | 
					
						
							| 
									
										
										
										
											2015-08-25 18:07:47 +02:00
										 |  |  |     'list-commands:Outputs all available Vagrant subcommands, even non-primary ones' | 
					
						
							| 
									
										
										
										
											2014-05-06 10:48:49 -07:00
										 |  |  |     'login:Authenticates against a Vagrant Cloud server to access protected boxes' | 
					
						
							| 
									
										
										
										
											2010-11-15 15:18:58 -05:00
										 |  |  |     'package:Packages a vagrant environment for distribution' | 
					
						
							| 
									
										
										
										
											2013-04-02 18:18:01 -07:00
										 |  |  |     'plugin:Plugin commands' | 
					
						
							| 
									
										
										
										
											2018-12-31 14:13:31 -05:00
										 |  |  |     'port:Displays information about guest port mappings' | 
					
						
							| 
									
										
										
										
											2010-11-15 15:18:58 -05:00
										 |  |  |     'provision:Run the provisioner' | 
					
						
							| 
									
										
										
										
											2015-08-25 18:07:47 +02:00
										 |  |  |     'push:Deploys code in this environment to a configured destination' | 
					
						
							|  |  |  |     'rdp:Connects to machine via RDP' | 
					
						
							| 
									
										
										
										
											2010-11-15 15:18:58 -05:00
										 |  |  |     'reload:Reload the vagrant environment' | 
					
						
							| 
									
										
										
										
											2018-10-02 15:56:50 -04:00
										 |  |  |     'resume:Resumes a suspended vagrant environment' | 
					
						
							| 
									
										
										
										
											2015-08-25 18:07:47 +02:00
										 |  |  |     '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' | 
					
						
							| 
									
										
										
										
											2016-05-10 08:09:12 +02:00
										 |  |  |     'snapshot:Manage snapshots with the guest machine' | 
					
						
							| 
									
										
										
										
											2010-11-15 15:18:58 -05:00
										 |  |  |     'ssh:SSH into the currently running environment' | 
					
						
							| 
									
										
										
										
											2015-08-25 18:07:47 +02:00
										 |  |  |     'ssh-config:Outputs .ssh/config valid syntax for connecting to this environment via ssh' | 
					
						
							| 
									
										
										
										
											2014-05-15 12:26:39 -07:00
										 |  |  |     'status:Shows the status of the current Vagrant environment' | 
					
						
							| 
									
										
										
										
											2010-11-15 15:18:58 -05:00
										 |  |  |     'suspend:Suspends the currently running vagrant environment' | 
					
						
							| 
									
										
										
										
											2016-05-21 17:51:30 -07:00
										 |  |  |     'snapshot:Used to manage snapshots with the guest machine' | 
					
						
							| 
									
										
										
										
											2010-11-15 15:18:58 -05:00
										 |  |  |     'up:Creates the vagrant environment' | 
					
						
							| 
									
										
										
										
											2018-12-31 14:13:31 -05:00
										 |  |  |     'validate:Validates the Vagrantfile' | 
					
						
							| 
									
										
										
										
											2015-08-25 18:07:47 +02:00
										 |  |  |     'version:Prints current and latest Vagrant version' | 
					
						
							| 
									
										
										
										
											2013-04-02 18:18:01 -07:00
										 |  |  |     '--help:[TASK] Describe available tasks or one specific task' | 
					
						
							|  |  |  |     '--version:Prints the Vagrant version information' | 
					
						
							| 
									
										
										
										
											2010-11-15 15:18:58 -05:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | local -a _box_arguments | 
					
						
							|  |  |  | _box_arguments=( | 
					
						
							| 
									
										
										
										
											2015-08-25 18:07:47 +02:00
										 |  |  |     'add:ADDRESS Adds a box to the system' | 
					
						
							|  |  |  |     'help:COMMAND List subcommands' | 
					
						
							| 
									
										
										
										
											2010-11-15 15:18:58 -05:00
										 |  |  |     'list:Lists all installed boxes' | 
					
						
							| 
									
										
										
										
											2015-08-25 18:07:47 +02:00
										 |  |  |     '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' | 
					
						
							| 
									
										
										
										
											2010-11-15 15:18:58 -05:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | __task_list () | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-11-15 14:56:01 -05:00
										 |  |  |     local expl | 
					
						
							|  |  |  |     declare -a tasks | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-31 14:13:31 -05:00
										 |  |  |     tasks=(box destroy halt init package port provision reload resume ssh ssh_config status suspend up version) | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-15 14:56:01 -05:00
										 |  |  |     _wanted tasks expl 'help' compadd $tasks | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | __box_list () | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-09-03 15:31:54 +09:00
										 |  |  |     _wanted application expl 'command' compadd $(command vagrant box list | sed -e 's/ /\\ /g') | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-07 15:09:06 -05:00
										 |  |  | __vm_list () | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2014-08-31 23:50:59 +02:00
										 |  |  |     _wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *[:"]\([a-zA-Z0-9_-]\+\)' 2>/dev/null | awk '{print substr($2, 2)}') | 
					
						
							| 
									
										
										
										
											2013-06-11 13:51:17 +02:00
										 |  |  |     _wanted application expl 'command' compadd $(command ls .vagrant/machines/ 2>/dev/null) | 
					
						
							| 
									
										
										
										
											2011-02-07 15:09:06 -05:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  | __vagrant-box () | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-11-15 14:56:01 -05:00
										 |  |  |     local curcontext="$curcontext" state line | 
					
						
							|  |  |  |     typeset -A opt_args | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-15 14:56:01 -05:00
										 |  |  |     _arguments -C \ | 
					
						
							|  |  |  |         ':command:->command' \ | 
					
						
							|  |  |  |         '*::options:->options' | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-15 14:56:01 -05:00
										 |  |  |    case $state in | 
					
						
							|  |  |  |        (command) | 
					
						
							| 
									
										
										
										
											2018-04-02 04:43:41 -07:00
										 |  |  |            _describe -t commands "vagrant subcommand" _box_arguments | 
					
						
							| 
									
										
										
										
											2010-11-15 14:56:01 -05:00
										 |  |  |            return | 
					
						
							|  |  |  |        ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |        (options) | 
					
						
							|  |  |  |            case $line[1] in | 
					
						
							|  |  |  |                (repackage|remove) | 
					
						
							| 
									
										
										
										
											2015-08-25 18:07:47 +02:00
										 |  |  |                    _arguments ':feature:__box_list' | 
					
						
							| 
									
										
										
										
											2010-11-15 14:56:01 -05:00
										 |  |  |                ;; | 
					
						
							|  |  |  |            esac | 
					
						
							|  |  |  |        ;; | 
					
						
							|  |  |  |     esac | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-15 15:18:58 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | local expl | 
					
						
							|  |  |  | local -a boxes installed_boxes | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-15 14:56:01 -05:00
										 |  |  | local curcontext="$curcontext" state line | 
					
						
							|  |  |  | typeset -A opt_args | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-15 14:56:01 -05:00
										 |  |  | _arguments -C \ | 
					
						
							|  |  |  |     ':command:->command' \ | 
					
						
							|  |  |  |     '*::options:->options' | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | case $state in | 
					
						
							|  |  |  |   (command) | 
					
						
							| 
									
										
										
										
											2018-04-02 04:43:41 -07:00
										 |  |  |       _describe -t commands "vagrant subcommand" _1st_arguments | 
					
						
							| 
									
										
										
										
											2010-11-15 14:56:01 -05:00
										 |  |  |       return | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  |   ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   (options) | 
					
						
							|  |  |  |     case $line[1] in | 
					
						
							|  |  |  |       (help) | 
					
						
							| 
									
										
										
										
											2015-08-25 18:07:47 +02:00
										 |  |  |          _arguments ':feature:__task_list' | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  |       ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       (box) | 
					
						
							| 
									
										
										
										
											2010-11-15 14:56:01 -05:00
										 |  |  |           __vagrant-box | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  |       ;; | 
					
						
							| 
									
										
										
										
											2018-12-31 14:13:31 -05:00
										 |  |  |       (up|provision|port|package|destroy|reload|ssh|ssh-config|halt|resume|status) | 
					
						
							| 
									
										
										
										
											2015-08-25 18:07:47 +02:00
										 |  |  |       _arguments ':feature:__vm_list' | 
					
						
							| 
									
										
										
										
											2010-11-15 14:45:04 -05:00
										 |  |  |     esac | 
					
						
							|  |  |  |   ;; | 
					
						
							|  |  |  | esac |