[pisa-src] r947 - trunk/tools

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Fri, 04 Sep 2009 19:28:10 +0200

Author: biurrun
Date: Fri Sep  4 19:28:10 2009
New Revision: 947

Log:
Extend usage() function with an exit value parameter.

Modified:
   trunk/tools/switch-ip

Modified: trunk/tools/switch-ip
==============================================================================
--- trunk/tools/switch-ip       Fri Sep  4 19:26:33 2009        (r946)
+++ trunk/tools/switch-ip       Fri Sep  4 19:28:10 2009        (r947)
@@ -93,6 +93,7 @@
     echo " --route_extra_cmd : run extra route command"
     echo " --nowep : associate without WEP keys for access points"
     echo " -h : this help message"
+    exit $1
 }
 
 ########################
@@ -122,8 +123,7 @@
     optval="${opt#*=}"
     case $opt in
         -h | --help )
-            usage
-            exit 0
+            usage 0
             ;;
         --interface=*)
             echo "my wireless interface = $optval"
@@ -175,8 +175,7 @@
             ;;
         *)
             echo "Unknown parameter $opt"
-            usage
-            exit 1
+            usage 1
             ;;
     esac
 done

Other related posts:

  • » [pisa-src] r947 - trunk/tools - Diego Biurrun