4 # vagrant zsh completion
6 local -a _1st_arguments
9 'cloud:Manages everything related to Vagrant Cloud'
10 'connect:Connects to a remotely shared Vagrant environment'
11 'destroy:Destroys the vagrant environment'
12 'docker-logs:Outputs the logs from the Docker container'
13 'docker-run:Run a one-off command in the context of a container'
14 'global-status:Reports the status of all active Vagrant environments on the system'
15 'halt:Halts the currently running vagrant environment'
16 'help:Shows the help for a subcommand'
17 'init:[box_name] [box_url] Initializes current folder for Vagrant usage'
18 'list-commands:Outputs all available Vagrant subcommands, even non-primary ones'
19 'login:Authenticates against a Vagrant Cloud server to access protected boxes'
20 'package:Packages a vagrant environment for distribution'
21 'plugin:Plugin commands'
22 'port:Displays information about guest port mappings'
23 'provision:Run the provisioner'
24 'push:Deploys code in this environment to a configured destination'
25 'rdp:Connects to machine via RDP'
26 'reload:Reload the vagrant environment'
27 'resume:Resumes a suspended vagrant environment'
28 'rsync:Syncs rsync synced folders to remote machine'
29 'rsync-auto:Syncs rsync synced folders automatically when files change'
30 'share:Shares your Vagrant environment with anyone in the world'
31 'snapshot:Manage snapshots with the guest machine'
32 'ssh:SSH into the currently running environment'
33 'ssh-config:Outputs .ssh/config valid syntax for connecting to this environment via ssh'
34 'status:Shows the status of the current Vagrant environment'
35 'suspend:Suspends the currently running vagrant environment'
36 'snapshot:Used to manage snapshots with the guest machine'
37 'up:Creates the vagrant environment'
38 'validate:Validates the Vagrantfile'
39 'version:Prints current and latest Vagrant version'
40 '--help:[TASK] Describe available tasks or one specific task'
41 '--version:Prints the Vagrant version information'
44 local -a _box_arguments
46 'add:ADDRESS Adds a box to the system'
47 'help:COMMAND List subcommands'
48 'list:Lists all installed boxes'
49 'outdated:Checks if a box has newer version'
50 'remove:NAME Removes a box from the system'
51 'repackage:NAME PROVIDER VERSION Repackages an installed box into a `.box` file'
52 'update:Updates box to a newer version, if available'
60 tasks=(box destroy halt init package port provision reload resume ssh ssh_config status suspend up version)
62 _wanted tasks expl 'help' compadd $tasks
67 _wanted application expl 'command' compadd $(command vagrant box list | sed -e 's/ *(.*)//g;s/ /\\ /g')
72 _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)}')
73 _wanted application expl 'command' compadd $(command ls "${VAGRANT_CWD:-.}/.vagrant/machines/" 2>/dev/null)
78 local curcontext="$curcontext" state line
82 ':command:->command' \
83 '*::options:->options'
87 _describe -t commands "vagrant subcommand" _box_arguments
94 _arguments ':feature:__box_list'
105 local -a boxes installed_boxes
107 local curcontext="$curcontext" state line
111 ':command:->command' \
112 '*::options:->options'
116 _describe -t commands "vagrant subcommand" _1st_arguments
123 _arguments ':feature:__task_list'
129 (up|provision|port|package|destroy|reload|ssh|ssh-config|halt|resume|status)
130 _arguments ':feature:__vm_list'