diff options
-rwxr-xr-x | scripts/config | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/config b/scripts/config index 9723c7de07cc..f65a44a7886a 100755 --- a/scripts/config +++ b/scripts/config | |||
@@ -17,6 +17,7 @@ commands: | |||
17 | Set option to "string" | 17 | Set option to "string" |
18 | --set-val option value | 18 | --set-val option value |
19 | Set option to value | 19 | Set option to value |
20 | --undefine|-u option Undefine option | ||
20 | --state|-s option Print state of option (n,y,m,undef) | 21 | --state|-s option Print state of option (n,y,m,undef) |
21 | 22 | ||
22 | --enable-after|-E beforeopt option | 23 | --enable-after|-E beforeopt option |
@@ -73,6 +74,12 @@ set_var() { | |||
73 | fi | 74 | fi |
74 | } | 75 | } |
75 | 76 | ||
77 | undef_var() { | ||
78 | local name=$1 | ||
79 | |||
80 | sed -ri "/^($name=|# $name is not set)/d" "$FN" | ||
81 | } | ||
82 | |||
76 | if [ "$1" = "--file" ]; then | 83 | if [ "$1" = "--file" ]; then |
77 | FN="$2" | 84 | FN="$2" |
78 | if [ "$FN" = "" ] ; then | 85 | if [ "$FN" = "" ] ; then |
@@ -134,6 +141,9 @@ while [ "$1" != "" ] ; do | |||
134 | set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=$1" | 141 | set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=$1" |
135 | shift | 142 | shift |
136 | ;; | 143 | ;; |
144 | --undefine|-u) | ||
145 | undef_var "${CONFIG_}$ARG" | ||
146 | ;; | ||
137 | 147 | ||
138 | --state|-s) | 148 | --state|-s) |
139 | if grep -q "# ${CONFIG_}$ARG is not set" $FN ; then | 149 | if grep -q "# ${CONFIG_}$ARG is not set" $FN ; then |