1
0
dotfiles/.config/zsh/alias/kconfig.zsh

18 lines
391 B
Bash
Raw Normal View History

2021-03-31 08:54:40 +03:00
#!/bin/zsh
kconf-set() {
2022-07-19 02:41:45 +03:00
local n v
n=$1 v=$2 ; shift 2
2021-03-31 08:54:40 +03:00
grep -ElZ "^((CONFIG_)?$n=|# (CONFIG_)?$n is not set)" "$@" \
| xargs -0 -r sed -i -E -e "s/^(((CONFIG_)?$n)=.+|# ((CONFIG_)?$n) is not set)\$/\\2\\4=$v/"
}
kconf-unset() {
2022-07-19 02:41:45 +03:00
local n
n=$1 ; shift
2021-03-31 08:54:40 +03:00
grep -ElZ "^(CONFIG_)?$n=" "$@" \
| xargs -0 -r sed -i -E -e "s/^((CONFIG_)?$n)=.+\$/# \\1 is not set/"
}