Add completion for snapshot names for vagrant snapshot restore|delete

- Note that this does not cover additional options like --no-provision
- It is also a bit slow, as `vagrant snapshot list` is used to gather
  the data
This commit is contained in:
Thomas Reifenberger 2017-10-13 12:59:01 +02:00
parent 1294289d96
commit 52bf853cee
1 changed files with 9 additions and 0 deletions

View File

@ -140,6 +140,15 @@ _vagrant() {
;;
esac
;;
"snapshot")
case "$prev" in
"restore"|"delete")
local snapshot_list=$(vagrant snapshot list)
COMPREPLY=($(compgen -W "${snapshot_list}" -- ${cur}))
return 0
;;
esac
;;
*)
;;
esac