aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
}