hdt: Add default callback for the DMI show module
authorPierre-Alexandre Meyer <pierre@mouraf.org>
Sun, 22 Mar 2009 03:29:49 +0000 (20:29 -0700)
committerPierre-Alexandre Meyer <pierre@mouraf.org>
Sun, 22 Mar 2009 03:29:49 +0000 (20:29 -0700)
Impact: Extend the cli.

`show' in the dmi mode now lists the available modules.

Misc.: remove noisy printf.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
com32/hdt/hdt-cli-dmi.c
com32/hdt/hdt-cli.c

index 5025bd3..0cd1bc3 100644 (file)
@@ -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 = {
index a35eed2..06c6a5b 100644 (file)
@@ -306,13 +306,11 @@ static void exec_command(char *line,
                }
                else {
                        find_cli_callback_descr(command, hdt_mode.default_modules,
-                                            &current_module);
+                                               &current_module);
                        if (current_module != NULL) {
                                current_module->exec(argc, argv, hardware);
                                return;
                        }
-
-                       printf("Command '%s' incorrect. See `help'.\n", command);
                }
        }