Last active
August 29, 2015 14:02
-
-
Save nickcarenza/0a0dd28db5108b0c72fc to your computer and use it in GitHub Desktop.
Provides tab completion of vagrant IDs and displays global-status report
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef vagrant | |
local context state line | |
typeset -A opt_args | |
local vagrant_status vagrant_ids | |
vagrant_status=$(vagrant global-status | head -5) | |
vagrant_ids=$(echo $vagrant_status | grep -oE '^[0-9a-z]+' | grep '[0-9]') | |
_arguments "2:$vagrant_status:($vagrant_ids)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make sure you name this file starting with an underscore
_
and save it somewhere in your$fpath
.In case your output is wonky, here are the zstyles I copied and pasted from somewhere: