Added an error message for mistyped options [ Bug #45946 ] and also shortened
authorTim Yamin <plasmaroo@gentoo.org>
Fri, 2 Apr 2004 20:40:41 +0000 (20:40 +0000)
committerTim Yamin <plasmaroo@gentoo.org>
Fri, 2 Apr 2004 20:40:41 +0000 (20:40 +0000)
the help list into two sections: a long one specified by --help and a short
default one.

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@103 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_cmdline.sh

index 3dadab6c78dfb9c2bbca2d58cbbd88348b866a41..a242972321707250afc0e0aa03310ed3916734f0 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-usage() {
+longusage() {
   echo "Gentoo Linux Genkernel ${GK_V}"
   echo "Usage: "
   echo "       genkernel [options] action"
@@ -66,6 +66,20 @@ usage() {
   echo "                                will be included."
 }
 
+usage() {
+  echo "Gentoo Linux Genkernel ${GK_V}"
+  echo "Usage: "
+  echo "       genkernel [options] all"
+  echo
+  echo "Some useful options:"
+  echo "       --menuconfig            Run menuconfig after oldconfig"
+  echo "       --no-clean              Do not run make clean before compilation"
+  echo "       --no-mrproper           Do not run make mrproper before compilation"
+  echo
+  echo "For a detailed list of supported options and flags; issue:"
+  echo "       genkernel --help"
+}
+
 parse_opt() {
        case "$1" in
                *\=*)
@@ -244,9 +258,14 @@ parse_cmdline() {
                      BUILD_KERNEL=1
              ;;
              --help)
-                     usage
+                     longusage
+                     exit 1
+             ;;
+             *)
+                     echo "Error: Unknown option '$*'!"
                      exit 1
              ;;
 
        esac
 }
+