Skip to content

Commit

Permalink
kconfig: factor code in menu_get_ext_help()
Browse files Browse the repository at this point in the history
Cc: Srinivas Kandagatla <[email protected]>
Signed-off-by: Arnaud Lacombe <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
lacombar authored and michal42 committed Aug 8, 2011
1 parent 3f198df commit 57e6292
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions scripts/kconfig/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

#include "lkc.h"

static const char nohelp_text[] = N_(
"There is no help available for this option.\n");
static const char nohelp_text[] = "There is no help available for this option.";

struct menu rootmenu;
static struct menu **last_entry_ptr;
Expand Down Expand Up @@ -595,15 +594,14 @@ struct gstr get_relations_str(struct symbol **sym_arr)
void menu_get_ext_help(struct menu *menu, struct gstr *help)
{
struct symbol *sym = menu->sym;
const char *help_text = nohelp_text;

if (menu_has_help(menu)) {
if (sym->name)
str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
str_append(help, _(menu_get_help(menu)));
str_append(help, "\n");
} else {
str_append(help, nohelp_text);
help_text = menu_get_help(menu);
}
str_printf(help, "%s\n", _(help_text));
if (sym)
get_symbol_str(help, sym);
}

0 comments on commit 57e6292

Please sign in to comment.