setconf icon indicating copy to clipboard operation
setconf copied to clipboard

add option for detete, comment and comment out keys

Open sl1pkn07 opened this issue 8 years ago • 2 comments

Hi. is possible add the option for:

  • Remove keys
  • Comment out keys (#esee = foo -> esee = foo)
  • Comment in keys (esee = foo -> #esee = foo)

greetings

sl1pkn07 avatar Sep 03 '17 14:09 sl1pkn07

Hi, thanks for the feature request. Yes, this is both possible and a feature that should be implemented. Will look at it.

xyproto avatar Sep 04 '17 05:09 xyproto

Added an option for uncommenting keys. Please test.

Will also consider adding options for removing and commenting out keys. Are these really needed, or would this be a task that sed is perfectly suited for, since this would not involve dealing with variety in whitespace and assignment symbols?

I'm wondering how setconf could improve upon these two sed commands:

Removing an option:

sed -i '/CONFIG_OPTION/d' filename

Commenting out an option:

sed -i 's/CONFIG_OPTION/#CONFIG_OPTION/g' filename

I guess Linux kernel configuration is a good example where something easier than sed would be nice, since the option should both be commented out and also be changed from =y to is not set.

xyproto avatar Oct 04 '17 12:10 xyproto