Giter Club home page Giter Club logo

vboxmanage-bash-completion's Introduction

VBoxManage bash completion script

This version of the completion was initially based on Sebastian T. Hafner script. However, in some point of time I've decided to rewrite it almost from scratch.

Current version of script was written and tested against VBoxManage in version 7.0.12, and should contain all commands and their options.

Unlike other attempts, I've tried to make the script context aware. See the simple session with the VBoxManage command below, to have an idea how it works:

VBoxManage session

Note, that startvm command proposes only VMs, which are not running, while controlvm will complete only running VMs.

What is worth to mention, this completion script is a real thing, so it only offer things which have sense for particular commands, for example:

Take a snapshot

For snapshot take subcommand, the only options which are proposed are --live and --description. Other commands and subcommands are behaving in similar way.

Installation

Either source the file:

$ . /path/to/this/repo/VBoxManage

or add it to a proper place depending on your distribution. Usual place would be:

  • ~/bash-completion.d/
  • /usr/local/etc/bash-completion.d/
  • /etc/bash_completion.d/
  • etc.

It's also okay to copy it into some directory, and place proper line in .profile or .bashrc:

source /some/directory/VBoxManage

License

This software is licensed under 3-clause BSD license. See LICENSE file for details.

vboxmanage-bash-completion's People

Contributors

gryf avatar mattalxndr avatar schplurtz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vboxmanage-bash-completion's Issues

a new request

great project. a request:
You could consider, if it is not very complicated, incorporate commands to create virtual disks for data storage (vdi), format them (ext4, ntfs, etc), mount and unmount them in linux. This is something that is only partially in the VBoxManager documentation and there is little information about these procedures

thanks in advanced

modifymedium no completion?

Hi,

thanks a lot for this completion script - big help.

I noticed that (at least on Ubuntu 16.04 with VirtualBox 5.0.18) there are no completions for VBoxManage modifymedium.

Would you happen to know how to fix that?

Kind regards,
Schlomo

Implement easy support for VBoxManage aliases

Thank you for creating this !!

I personally use an alias vb, instead of VBoxManage as it is much quicker to type.

Adding the autocompletion for vb can be quickly accomplished via:

complete -o default -F _VBoxManage vb

but someone else might prefer to have this working in a different alias. Hence my recommendation.

The script can support virtually any alias, without hardcoding, by extending the autocompletion to cover the script's name:

complete -o default -F _VBoxManage $(basename "${BASH_SOURCE[0]}")

This way, when people download the "VirtualBoxManage" autocompletion script, they can rename it to whatever they want and the autocompletion will work for the command with that name.

For instance, if your file is downloaded and saved as "myvb", the autocompletion will be available when myvb is typed in bash.

It's difficult to choose the correct sed to use

Hi,
I run macos. There, default sed is a bsd sed that doesn't understand \s \n and the other \ sequences. sed is used everywhere, I can install gnu sed easily with some package manager, but then I have to edit the script and change every sed command so it uses that installed sed command. This is complex and must be done for each version.

I'll add a PR to let user easily choose the sed command.

Source VBoxManage exists

Has anybody experienced sourcing VBoxManage closes the shell? ๐Ÿค”

I get the following error
Unknown application - bash

Doesn't work correctly in Mac

Hi,

the default shell for MacOS is Bash 3. compopt does not exist in Bash 3 so completion fails on the occasions compopt is called. it would be great to have a fix.

bad snapshot completion with delete subcommand

Hi,

I have the following problem with vBoxManage snapshot foo delete <TAB>

$ vbm snapshot debian take 'first tryage'
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Snapshot taken. UUID: 64f93dfc-5331-41b6-968d-fa1157ff4ac6
$ vbm snapshot debian take 'second tryage'
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Snapshot taken. UUID: 4044ac15-6025-4eba-9d7d-fe6ed1e82e04
$ vbm snapshot debian delete <TAB>
\ econd tryage  fir\ t tryage
$ vbm snapshot debian delete t<TAB>
$ vbm snapshot debian delete fir\ t tryage
Oracle VM VirtualBox Command Line Management Interface Version 5.2.26
(C) 2005-2019 Oracle Corporation
All rights reserved.

Usage: 
... etc....

I guess my sed is not of the correct type/version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.