diff options
Diffstat (limited to 'plugins/vagrant')
| -rw-r--r-- | plugins/vagrant/README.md | 30 | ||||
| -rw-r--r-- | plugins/vagrant/_vagrant | 13 | ||||
| -rw-r--r-- | plugins/vagrant/vagrant.plugin.zsh | 33 | 
3 files changed, 71 insertions, 5 deletions
diff --git a/plugins/vagrant/README.md b/plugins/vagrant/README.md index f6ea87b0e..331bfa143 100644 --- a/plugins/vagrant/README.md +++ b/plugins/vagrant/README.md @@ -8,3 +8,33 @@ To use it, add `vagrant` to the plugins array in your zshrc file:  plugins=(... vagrant)  ``` +## Aliases + +| Alias   | Command                      | +|---------|------------------------------| +| `vgi`   | `vagrant init`               | +| `vup`   | `vagrant up`                 | +| `vd`    | `vagrant destroy`            | +| `vdf`   | `vagrant destroy -f`         | +| `vssh`  | `vagrant ssh`                | +| `vsshc` | `vagrant ssh-config`         | +| `vrdp`  | `vagrant rdp`                | +| `vh`    | `vagrant halt`               | +| `vssp`  | `vagrant suspend`            | +| `vst`   | `vagrant status`             | +| `vre`   | `vagrant resume`             | +| `vgs`   | `vagrant global-status`      | +| `vpr`   | `vagrant provision`          | +| `vr`    | `vagrant reload`             | +| `vrp`   | `vagrant reload --provision` | +| `vp`    | `vagrant push`               | +| `vsh`   | `vagrant share`              | +| `vba`   | `vagrant box add`            | +| `vbr`   | `vagrant box remove`         | +| `vbl`   | `vagrant box list`           | +| `vbo`   | `vagrant box outdated`       | +| `vbu`   | `vagrant box update`         | +| `vpli`  | `vagrant plugin install`     | +| `vpll`  | `vagrant plugin list`        | +| `vplun` | `vagrant plugin uninstall`   | +| `vplu`  | `vagrant plugin update`      | diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index a99a8f0e7..e88835506 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -6,6 +6,7 @@  local -a _1st_arguments  _1st_arguments=(      'box:Box commands' +    'cloud:Manages everything related to Vagrant Cloud'      'connect:Connects to a remotely shared Vagrant environment'      'destroy:Destroys the vagrant environment'      'docker-logs:Outputs the logs from the Docker container' @@ -18,6 +19,7 @@ _1st_arguments=(      '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' @@ -33,6 +35,7 @@ _1st_arguments=(      'suspend:Suspends the currently running vagrant environment'      'snapshot:Used to manage snapshots with the guest machine'      'up:Creates the vagrant environment' +    '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' @@ -54,20 +57,20 @@ __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  }  __box_list ()  { -    _wanted application expl 'command' compadd $(command vagrant box list | sed -e 's/ /\\ /g') +    _wanted application expl 'command' compadd $(command vagrant box list | sed -e 's/  *(.*)//g;s/ /\\ /g')  }  __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 () @@ -123,7 +126,7 @@ case $state in        (box)            __vagrant-box        ;; -      (up|provision|package|destroy|reload|ssh|ssh-config|halt|resume|status) +      (up|provision|port|package|destroy|reload|ssh|ssh-config|halt|resume|status)        _arguments ':feature:__vm_list'      esac    ;; diff --git a/plugins/vagrant/vagrant.plugin.zsh b/plugins/vagrant/vagrant.plugin.zsh new file mode 100644 index 000000000..a4e9b06c2 --- /dev/null +++ b/plugins/vagrant/vagrant.plugin.zsh @@ -0,0 +1,33 @@ +alias vgi="vagrant init" + +alias vup="vagrant up" +alias vd="vagrant destroy" +alias vdf="vagrant destroy -f" + +alias vssh="vagrant ssh" +alias vsshc="vagrant ssh-config" +alias vrdp="vagrant rdp" + +alias vh="vagrant halt" +alias vssp="vagrant suspend" +alias vst="vagrant status" +alias vre="vagrant resume" +alias vgs="vagrant global-status" + +alias vpr="vagrant provision" +alias vr="vagrant reload" +alias vrp="vagrant reload --provision" + +alias vp="vagrant push" +alias vsh="vagrant share" + +alias vba="vagrant box add" +alias vbr="vagrant box remove" +alias vbl="vagrant box list" +alias vbo="vagrant box outdated" +alias vbu="vagrant box update" + +alias vpli="vagrant plugin install" +alias vpll="vagrant plugin list" +alias vplun="vagrant plugin uninstall" +alias vplu="vagrant plugin update"  | 
