diff options
-rw-r--r-- | com32/hdt/hdt-cli.c | 6 | ||||
-rw-r--r-- | com32/hdt/hdt-common.c | 14 | ||||
-rw-r--r-- | com32/hdt/hdt-common.h | 3 | ||||
-rw-r--r-- | com32/hdt/hdt-menu.c | 16 |
4 files changed, 20 insertions, 19 deletions
diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c index 77b66941..cddb4372 100644 --- a/com32/hdt/hdt-cli.c +++ b/com32/hdt/hdt-cli.c @@ -755,7 +755,7 @@ void start_auto_mode(struct s_hardware *hardware) int nb_commands=0; char *commands[MAX_NB_AUTO_COMMANDS]; - if (debug) + if (!quiet) more_printf("\nEntering Auto mode\n"); /* Protecting the auto_label from the strtok modifications */ @@ -778,14 +778,14 @@ void start_auto_mode(struct s_hardware *hardware) for (int i=1;i<=nb_commands;i++) { if (commands[i]) { more_printf("\n"); - if (debug) + if (!quiet) more_printf("> Auto mode: Executing %d/%d : '%s'\n", i, nb_commands, commands[i]); exec_command(commands[i], hardware); free(commands[i]); } } - if (debug) + if (!quiet) more_printf("\nExiting Auto mode\n"); more_printf("\n"); diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c index c5433e2f..5cfa9e87 100644 --- a/com32/hdt/hdt-common.c +++ b/com32/hdt/hdt-common.c @@ -55,12 +55,12 @@ void convert_isolinux_filename(char *filename, struct s_hardware *hardware) { void detect_parameters(const int argc, const char *argv[], struct s_hardware *hardware) { - /* Debug mode - make the output more verbose */ - debug = false; + /* Quiet mode - make the output more quiet */ + quiet = false; for (int i = 1; i < argc; i++) { - if (!strncmp(argv[i], "debug", 5)) { - debug = true; + if (!strncmp(argv[i], "quiet", 5)) { + quiet = true; } else if (!strncmp(argv[i], "modules_pcimap=", 15)) { strncpy(hardware->modules_pcimap_path, argv[i] + 15, sizeof(hardware->modules_pcimap_path)); @@ -483,7 +483,7 @@ void detect_pci(struct s_hardware *hardware) hardware->nb_pci_devices++; } - if (debug) { + if (!quiet) { more_printf("PCI: %d devices detected\n", hardware->nb_pci_devices); more_printf("PCI: Resolving names\n"); } @@ -491,14 +491,14 @@ void detect_pci(struct s_hardware *hardware) hardware->pci_ids_return_code = get_name_from_pci_ids(hardware->pci_domain, hardware->pciids_path); - if (debug) + if (!quiet) more_printf("PCI: Resolving class names\n"); /* Assigning class name for each device */ hardware->pci_ids_return_code = get_class_name_from_pci_ids(hardware->pci_domain, hardware->pciids_path); - if (debug) + if (!quiet) more_printf("PCI: Resolving module names\n"); /* Detecting which kernel module should match each device using modules.pcimap*/ hardware->modules_pcimap_return_code = diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h index 7ed3e489..f178b223 100644 --- a/com32/hdt/hdt-common.h +++ b/com32/hdt/hdt-common.h @@ -66,7 +66,8 @@ /* The char that surround the list of commands */ #define AUTO_DELIMITER "'" -bool debug; +/* Defines if the cli is quiet*/ +bool quiet; extern int display_line_nb; extern bool disable_more_printf; diff --git a/com32/hdt/hdt-menu.c b/com32/hdt/hdt-menu.c index abdf0a2c..98eb45e7 100644 --- a/com32/hdt/hdt-menu.c +++ b/com32/hdt/hdt-menu.c @@ -51,7 +51,7 @@ int start_menu_mode(struct s_hardware *hardware, char *version_string) t_menuitem *curr; char cmd[160]; - if (debug) + if (!quiet) more_printf("Starting Menu (%d menus)\n", hdt_menu.total_menu_count); curr = showmenus(hdt_menu.main_menu.menu); /* When we exit the menu, do we have something to do? */ @@ -302,37 +302,37 @@ void compute_main_menu(struct s_hdt_menu *hdt_menu, struct s_hardware *hardware) void detect_hardware(struct s_hardware *hardware) { - if (debug) + if (!quiet) more_printf("CPU: Detecting\n"); cpu_detect(hardware); - if (debug) + if (!quiet) more_printf("DISKS: Detecting\n"); detect_disks(hardware); - if (debug) + if (!quiet) more_printf("DMI: Detecting Table\n"); if (detect_dmi(hardware) == -ENODMITABLE) { printf("DMI: ERROR ! Table not found ! \n"); printf ("DMI: Many hardware components will not be detected ! \n"); } else { - if (debug) + if (!quiet) more_printf("DMI: Table found ! (version %u.%u)\n", hardware->dmi.dmitable.major_version, hardware->dmi.dmitable.minor_version); } - if (debug) + if (!quiet) more_printf("VPD: Detecting\n"); detect_vpd(hardware); #ifdef WITH_PCI detect_pci(hardware); - if (debug) + if (!quiet) more_printf("PCI: %d Devices Found\n", hardware->nb_pci_devices); #endif - if (debug) + if (!quiet) more_printf("VESA: Detecting\n"); detect_vesa(hardware); } |