4 # vagrant zsh completion
6 local -a _1st_arguments
9 'destroy:Destroys the vagrant environment'
10 'halt:Halts the currently running vagrant environment'
11 'help:[TASK] Describe available tasks or one specific task'
12 'init:[box_name] [box_url] Initializes current folder for Vagrant usage'
13 'package:Packages a vagrant environment for distribution'
14 'provision:Run the provisioner'
15 'reload:Reload the vagrant environment'
16 'resume:Resumes a suspend vagrant environment'
17 'ssh:SSH into the currently running environment'
18 'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.'
19 'status:Shows the status of the current Vagrant environment.'
20 'suspend:Suspends the currently running vagrant environment'
21 'up:Creates the vagrant environment'
22 'version:Prints the Vagrant version information'
25 local -a _box_arguments
27 'add:NAME URI Add a box to the system'
28 'help:COMMAND Describe subcommands or one specific subcommand'
29 'list:Lists all installed boxes'
30 'remove:NAME Remove a box from the system'
31 'repackage:NAME Repackage an installed box into a `.box` file.'
39 tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version)
41 _wanted tasks expl 'help' compadd $tasks
46 _wanted application expl 'command' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g')
51 _wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *:\([a-zA-Z0-9]\+\)' 2>/dev/null | cut -d: -f2)
56 local curcontext="$curcontext" state line
60 ':command:->command' \
61 '*::options:->options'
65 _describe -t commands "gem subcommand" _box_arguments
72 _arguments ':feature:__box_list'
83 local -a boxes installed_boxes
85 local curcontext="$curcontext" state line
89 ':command:->command' \
90 '*::options:->options'
94 _describe -t commands "gem subcommand" _1st_arguments
101 _arguments ':feature:__task_list'
107 (up|provision|package|destroy|reload|ssh|halt|resume|status)
108 _arguments ':feature:__vm_list'