aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-03-10 14:11:06 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-03-10 14:11:06 -0300
commiteb13690042fd1cff11e1918f421c0dbf1b0ef37a (patch)
tree8de95d4756ae1f0cfe72e8686436fcc3e72809a1
parentd3b73afd6c66de14783efc156b69fd47d2b29f1e (diff)
downloadkvmx-eb13690042fd1cff11e1918f421c0dbf1b0ef37a.tar.gz
kvmx-eb13690042fd1cff11e1918f421c0dbf1b0ef37a.tar.bz2
Enhanced usage
-rwxr-xr-xkvmx24
1 files changed, 20 insertions, 4 deletions
diff --git a/kvmx b/kvmx
index 95873dc..6fd328d 100755
--- a/kvmx
+++ b/kvmx
@@ -118,13 +118,29 @@ function kvmx_up {
# Display usage
function kvmx_usage {
- echo "$BASENAME $VERSION"
+ echo "$BASENAME $VERSION - virtual machine manager"
+ echo ""
echo "usage: $BASENAME <action> [options]"
+ echo ""
+ echo "available actions:"
+ echo ""
+ grep "^function kvmx_" $0 | cut -d ' ' -f 2 | sed -e 's/kvmx_/\t/'
+ echo ""
echo "examples:"
echo ""
- echo "$BASENAME list"
- echo "$BASENAME init <machine> [folder]"
- echo "$BASENAME clone <orig-guest> <dest-folder>"
+ echo -e "\t$BASENAME list"
+ echo -e "\t$BASENAME init <machine> [folder]"
+ echo -e "\t$BASENAME clone <orig-guest> <dest-folder>"
+ echo ""
+
+ local list="`kvmx_list | xargs`"
+
+ if [ ! -z "$list" ]; then
+ echo "available virtual machines:"
+ echo ""
+ echo -e "\t$list"
+ echo ""
+ fi
exit 1
}