]> www.infradead.org Git - mtd-utils.git/commitdiff
load_nandsim.sh: introduce a separate usage function
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 3 Aug 2012 07:19:07 +0000 (10:19 +0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 3 Aug 2012 07:19:07 +0000 (10:19 +0300)
Just because this is more readable.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
load_nandsim.sh

index 87d4f60866eaae3096492d29f9f9a623524d59a8..1df3813bc9c22574c44fd2a782576d6e65441111 100755 (executable)
@@ -13,11 +13,8 @@ fatal()
         exit 1
 }
 
-if grep -q "NAND simulator" /proc/mtd; then
-       fatal "nandsim is already loaded"
-fi
-
-if [ "$#" -lt "1" ]; then
+usage()
+{
        cat 1>&2 <<EOF
 Load NAND simulator to simulate flash of a specified size.
 
@@ -58,6 +55,14 @@ Only the following combinations are supported:
 | 1024       | 512           | 2048              |
 --------------------------------------------------
 EOF
+}
+
+if grep -q "NAND simulator" /proc/mtd; then
+       fatal "nandsim is already loaded"
+fi
+
+if [ "$#" -lt "1" ]; then
+       usage
        exit 1
 fi