watchdog: Improve initialisation error message and documentation
[pandora-kernel.git] / scripts / config
index 30825a5..608d7fd 100755 (executable)
@@ -9,8 +9,10 @@ config options command ...
 commands:
        --enable|-e option   Enable option
        --disable|-d option  Disable option
-       --module|-m option      Turn option into a module
-       --state|-s option       Print state of option (n,y,m,undef)
+       --module|-m option   Turn option into a module
+       --set-str option value
+                            Set option to "value"
+       --state|-s option    Print state of option (n,y,m,undef)
 
        --enable-after|-E beforeopt option
                              Enable option directly after other option
@@ -62,8 +64,7 @@ if [ "$1" = "--file" ]; then
        if [ "$FN" = "" ] ; then
                usage
        fi
-       shift
-       shift
+       shift 2
 else
        FN=.config
 fi
@@ -76,26 +77,39 @@ while [ "$1" != "" ] ; do
        CMD="$1"
        shift
        case "$CMD" in
-       --enable|-e)
+       --refresh)
+               ;;
+       --*-after)
+               checkarg "$1"
+               A=$ARG
+               checkarg "$2"
+               B=$ARG
+               shift 2
+               ;;
+       --*)
                checkarg "$1"
-               set_var "CONFIG_$ARG" "CONFIG_$ARG=y"
                shift
                ;;
+       esac
+       case "$CMD" in
+       --enable|-e)
+               set_var "CONFIG_$ARG" "CONFIG_$ARG=y"
+               ;;
 
        --disable|-d)
-               checkarg "$1"
                set_var "CONFIG_$ARG" "# CONFIG_$ARG is not set"
-               shift
                ;;
 
        --module|-m)
-               checkarg "$1"
                set_var "CONFIG_$ARG" "CONFIG_$ARG=m"
+               ;;
+
+       --set-str)
+               set_var "CONFIG_$ARG" "CONFIG_$ARG=\"$1\""
                shift
                ;;
 
        --state|-s)
-               checkarg "$1"
                if grep -q "# CONFIG_$ARG is not set" $FN ; then
                        echo n
                else
@@ -108,37 +122,18 @@ while [ "$1" != "" ] ; do
                                echo "$V"
                        fi
                fi
-               shift
                ;;
 
        --enable-after|-E)
-               checkarg "$1"
-               A=$ARG
-               checkarg "$2"
-               B=$ARG
                set_var "CONFIG_$B" "CONFIG_$B=y" "CONFIG_$A"
-               shift
-               shift
                ;;
 
        --disable-after|-D)
-               checkarg "$1"
-               A=$ARG
-               checkarg "$2"
-               B=$ARG
                set_var "CONFIG_$B" "# CONFIG_$B is not set" "CONFIG_$A"
-               shift
-               shift
                ;;
 
        --module-after|-M)
-               checkarg "$1"
-               A=$ARG
-               checkarg "$2"
-               B=$ARG
                set_var "CONFIG_$B" "CONFIG_$B=m" "CONFIG_$A"
-               shift
-               shift
                ;;
 
        # undocumented because it ignores --file (fixme)