From c925574af88e05b9847dbfd9521d3e9fb3dc59df Mon Sep 17 00:00:00 2001
From: Roger Luethi <rl@patchworkscience.org>
Date: Sun, 15 Mar 2015 11:38:17 +0100
Subject: [PATCH] labs: reformat osbash.sh usage text

This patch reformat the usage text for osbash.sh to (hopefully) be more
readable, more accurate, and to make space for a new option to be added
in a later patch. Also adds "--help" option as an alternative for "-h".

Change-Id: I7c41030ab988b27100c313f3242bf45794b87aa2
---
 labs/osbash.sh | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/labs/osbash.sh b/labs/osbash.sh
index 0eaa5642..b1255fa3 100755
--- a/labs/osbash.sh
+++ b/labs/osbash.sh
@@ -22,24 +22,22 @@ source "$OSBASH_LIB_DIR/virtualbox.install_base"
 source "$LIB_DIR/osbash/lib.color"
 
 function usage {
-    echo "Usage: $0 {-b|-w} [-g GUI] [--no-color] [-n] {basedisk|NODE [NODE..]}"
+    echo "Usage: $0 {-b|-w} [-g GUI] [--no-color] [-n] {TARGET}"
     # Don't advertise export until it is working properly
     # echo "       $0 [-e EXPORT] [-n] NODE [NODE..]"
-    echo ""
-    echo "-h        Help"
-    echo "-n        Print configuration status and exit"
-    echo "-b        Build basedisk (if necessary) and node VMs (if any)"
-    echo "-w        Create Windows batch files"
-    echo "-g GUI    GUI type during build"
-    #echo "-e EXPORT Export node VMs"
-    echo "--no-color  Disables colors during build"
-    echo ""
-    echo "basedisk  Build configured basedisk"
-    echo "cluster   Build OpenStack cluster [all nodes]" \
-                "(and basedisk if necessary)"
     echo
-    echo "GUI       gui, sdl, or headless"
-    echo "          (choose GUI type for VirtualBox)"
+    echo "-h|--help  Help"
+    echo "-n         Print configuration status and exit"
+    echo "-b         Build basedisk (if necessary) and node VMs (if any)"
+    echo "-w         Create Windows batch files"
+    echo "-g GUI     GUI type during build"
+    #echo "-e EXPORT Export node VMs"
+    echo "--no-color Disables colors during build"
+    echo
+    echo "TARGET     basedisk: build configured basedisk"
+    echo "           cluster : build OpenStack cluster [all nodes]"
+    echo "                     (and basedisk if necessary)"
+    echo "GUI        gui, sdl, or headless (GUI type for VirtualBox)"
     #echo "EXPORT    ova (OVA package file) or dir (VM clone directory)"
     exit
 }
@@ -102,6 +100,9 @@ while getopts :be:g:-:hnw opt; do
                 no-color)
                     unset CError CStatus CInfo CProcess CData CMissing CReset
                     ;;
+                help)
+                    usage
+                    ;;
                 *)
                     echo -e "${CError:-}Error: invalid option -$OPTARG${CReset:-}"
                     echo