If the script is ran without parameters or with -h, the usage
message is printed.

Signed-off-by: Erez Zilber <[EMAIL PROTECTED]>
---
 scripts/tgt-setup-lun |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/tgt-setup-lun b/scripts/tgt-setup-lun
index 824c7d3..53bb934 100755
--- a/scripts/tgt-setup-lun
+++ b/scripts/tgt-setup-lun
@@ -129,14 +129,19 @@ check_if_tgt_exists()
        return 0
 }
 
-while getopts "d:n:" opt
+if [ $# -eq 0 ]; then
+       usage
+       exit 1
+fi
+
+while getopts "d:n:h" opt
 do
        case ${opt} in
        d)
                dev=$OPTARG;;
        n)
                tgt_name=$OPTARG;;
-       *)
+       h*)
                usage
                exit 1
        esac
-- 
1.5.3


_______________________________________________
Stgt-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/stgt-devel

Reply via email to