Merging in latest version from kura/vagrant-bash-completion
This commit is contained in:
parent
98f8b51180
commit
13f4b62018
|
@ -22,6 +22,7 @@
|
|||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
|
||||
__pwdln() {
|
||||
pwdmod="${PWD}/"
|
||||
itr=0
|
||||
|
@ -52,7 +53,7 @@ __vagrantinvestigate() {
|
|||
_vagrant() {
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
commands="box connect destroy halt help init list-commands login package plugin provision reload resume rsync rsync-auto share ssh ssh-config status suspend up"
|
||||
commands="box connect destroy docker-logs docker-run global-status halt help init list-commands login package plugin provision rdp reload resume rsync rsync-auto share ssh ssh-config status suspend up version"
|
||||
|
||||
if [ $COMP_CWORD == 1 ]
|
||||
then
|
||||
|
@ -68,13 +69,19 @@ _vagrant() {
|
|||
COMPREPLY=($(compgen -W "${box_list}" -- ${cur}))
|
||||
return 0
|
||||
;;
|
||||
"ssh"|"provision"|"reload"|"halt"|"suspend"|"resume"|"ssh-config"|"up")
|
||||
"up")
|
||||
local up_commands="--no-provision"
|
||||
COMPREPLY=($(compgen -W "${up_commands}" -- ${cur}))
|
||||
return 0
|
||||
;;
|
||||
"ssh"|"provision"|"reload"|"halt"|"suspend"|"resume"|"ssh-config")
|
||||
vagrant_state_file=$(__vagrantinvestigate) || return 1
|
||||
if [[ -f $vagrant_state_file ]]; then
|
||||
running_vm_list=$(grep 'active' $vagrant_state_file | sed -e 's/"active"://' | tr ',' '\n' | cut -d '"' -f 2 | tr '\n' ' ')
|
||||
else
|
||||
running_vm_list=$(find $vagrant_state_file -type f -name "id" | awk -F"/" '{print $(NF-2)}')
|
||||
fi
|
||||
if [[ -f $vagrant_state_file ]]
|
||||
then
|
||||
running_vm_list=$(grep 'active' $vagrant_state_file | sed -e 's/"active"://' | tr ',' '\n' | cut -d '"' -f 2 | tr '\n' ' ')
|
||||
else
|
||||
running_vm_list=$(find $vagrant_state_file -type f -name "id" | awk -F"/" '{print $(NF-2)}')
|
||||
fi
|
||||
COMPREPLY=($(compgen -W "${running_vm_list}" -- ${cur}))
|
||||
return 0
|
||||
;;
|
||||
|
|
Loading…
Reference in New Issue