rpm/run.dist.sh: add usage statement
authorChris Wright <chrisw@sous-sol.org>
Sun, 19 Jan 2014 07:28:19 +0000 (23:28 -0800)
committerChris Wright <chrisw@sous-sol.org>
Sun, 19 Jan 2014 19:32:02 +0000 (11:32 -0800)
when executed with invalid cmdline parameter or the new 'help' cmdline
parameter, print out a usage statement.

Change-Id: I854fecfaa897e9b6d0f85adb84707357d449a20b
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
packaging/rpm/run.dist.sh

index 15dd0def57328d4be34581c04e45f2cef8758309..35db923b04e3ad6e2f7250941a62504d61cbb531 100755 (executable)
@@ -1,5 +1,19 @@
 #!/bin/bash
 
+usage() {
+    echo -e "Usage:\t$0 base|virt-ovsdb|virt-vtn|virt-opendove|sp|-stop|-status|help\n"
+
+    echo -e "\tbase: base controller edition, good for simple testing"
+    echo -e "\tvirt-ovsdb: virtualization controller edition based on ovsdb"
+    echo -e "\tvirt-vtn: virtualization controller edition based on vtn
+    (not supported yet)"
+    echo -e "\tvirt-opendove: virtualization controller edition based on opendove (not supported yet)"
+    echo -e "\tsp: service provider controller edition (not supported yet)"
+    echo -e "\t-stop: stop the controller"
+    echo -e "\t-status: check if controller is currently running"
+    echo -e "\thelp: generate this help text"
+}
+
 option=$1;
 shift
 
@@ -39,8 +53,13 @@ sp)
     exec /usr/share/opendaylight-controller/run.internal.sh -status
     ;;
 
+help)
+    usage
+    exit 0
+    ;;
 *)
     echo "Invalid option: $option"
+    usage
     ;;
 esac