From e0398422e4bbc8efac5628b18e69c5a55be54946 Mon Sep 17 00:00:00 2001 From: Pierre-Alexandre Meyer Date: Sat, 21 Mar 2009 20:29:49 -0700 Subject: [PATCH] hdt: Add default callback for the DMI show module Impact: Extend the cli. `show' in the dmi mode now lists the available modules. Misc.: remove noisy printf. Signed-off-by: Pierre-Alexandre Meyer --- com32/hdt/hdt-cli-dmi.c | 5 +++-- com32/hdt/hdt-cli.c | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/com32/hdt/hdt-cli-dmi.c b/com32/hdt/hdt-cli-dmi.c index 5025bd3..0cd1bc3 100644 --- a/com32/hdt/hdt-cli-dmi.c +++ b/com32/hdt/hdt-cli-dmi.c @@ -450,8 +450,9 @@ struct cli_callback_descr list_dmi_show_modules[] = { }; struct cli_module_descr dmi_show_modules = { - .modules = list_dmi_show_modules, - .nb_modules = CLI_DMI_MAX_MODULES, + .modules = list_dmi_show_modules, + .nb_modules = CLI_DMI_MAX_MODULES, + .default_callback = main_show_dmi, }; struct cli_mode_descr dmi_mode = { diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c index a35eed2..06c6a5b 100644 --- a/com32/hdt/hdt-cli.c +++ b/com32/hdt/hdt-cli.c @@ -306,13 +306,11 @@ static void exec_command(char *line, } else { find_cli_callback_descr(command, hdt_mode.default_modules, - ¤t_module); + ¤t_module); if (current_module != NULL) { current_module->exec(argc, argv, hardware); return; } - - printf("Command '%s' incorrect. See `help'.\n", command); } } -- 2.7.4