mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 15:11:16 +00:00
kconfig: factor code in menu_get_ext_help()
Cc: Srinivas Kandagatla <srinivas.kandagatla@st.com> Signed-off-by: Arnaud Lacombe <lacombar@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
This commit is contained in:
parent
3f198dfee4
commit
57e6292da6
1 changed files with 4 additions and 6 deletions
|
@ -10,8 +10,7 @@
|
||||||
|
|
||||||
#include "lkc.h"
|
#include "lkc.h"
|
||||||
|
|
||||||
static const char nohelp_text[] = N_(
|
static const char nohelp_text[] = "There is no help available for this option.";
|
||||||
"There is no help available for this option.\n");
|
|
||||||
|
|
||||||
struct menu rootmenu;
|
struct menu rootmenu;
|
||||||
static struct menu **last_entry_ptr;
|
static struct menu **last_entry_ptr;
|
||||||
|
@ -595,15 +594,14 @@ struct gstr get_relations_str(struct symbol **sym_arr)
|
||||||
void menu_get_ext_help(struct menu *menu, struct gstr *help)
|
void menu_get_ext_help(struct menu *menu, struct gstr *help)
|
||||||
{
|
{
|
||||||
struct symbol *sym = menu->sym;
|
struct symbol *sym = menu->sym;
|
||||||
|
const char *help_text = nohelp_text;
|
||||||
|
|
||||||
if (menu_has_help(menu)) {
|
if (menu_has_help(menu)) {
|
||||||
if (sym->name)
|
if (sym->name)
|
||||||
str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
|
str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
|
||||||
str_append(help, _(menu_get_help(menu)));
|
help_text = menu_get_help(menu);
|
||||||
str_append(help, "\n");
|
|
||||||
} else {
|
|
||||||
str_append(help, nohelp_text);
|
|
||||||
}
|
}
|
||||||
|
str_printf(help, "%s\n", _(help_text));
|
||||||
if (sym)
|
if (sym)
|
||||||
get_symbol_str(help, sym);
|
get_symbol_str(help, sym);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue