Comments
Patch
@@ -158,8 +158,11 @@ static int conf_sym(struct menu *menu)
struct symbol *sym = menu->sym;
int type;
tristate oldval, newval;
+ char *p;
while (1) {
+ if (sym->remark)
+ printf("Remark: %s\n", sym->remark);
printf("%*s%s ", indent - 1, "", _(menu->prompt->text));
if (sym->name)
printf("(%s) ", sym->name);
@@ -214,6 +217,8 @@ static int conf_sym(struct menu *menu)
break;
case '?':
goto help;
+ case '<':
+ goto remark;
default:
continue;
}
@@ -221,6 +226,20 @@ static int conf_sym(struct menu *menu)
return 0;
help:
print_help(menu);
+ continue;
+remark:
+ if (sym->remark)
+ printf("Current Remark: %s\n", sym->remark);
+ printf(" New remark: ");
+ fgets(line, sizeof(line), stdin);
+
+ if ((p = strchr(line, '\n')))
+ *p = '\0'; /* no \n in remark */
+ if (line[0]) {
+ if (sym->remark)
+ free(sym->remark);
+ sym->remark = strdup(line);
+ }
}
}
In conf_sym(), which is used for ask for all bool/tristate symbols, print sym->remark (if one exists) befor prompting for the option and analogous to help (triggered by an input beginning with '?'), when the user enters a line starting with '<', allow the user to enter a remark or update it. This extension does not cover the configuration of string, integer or choice values. I leave this open for follow-up submission in case there is interest in the config symbol remarks in general and in really supporting these also fully in make config, oldconfig and (possibly) silbings. Signed-off-by: Bernhard Kaindl <bernhard.kaindl@gmx.net> PS: make gconfig could also be considered for extension, but it does apparently does not have a great deal of string editing UI yet, so adding remarks to it would require finding a way to edit string symbols in it first. --- scripts/kconfig/conf.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-)