Show
Ignore:
Timestamp:
11/01/09 12:05:07 (3 years ago)
Author:
Erwan Velu <erwan.velu@…>
Children:
079f92a31281573b8a7b152b1730e7a349ac6365
Parents:
a7f6dd2b9fc3f8ad29a05135c99288156961329b
git-author:
Pierre-Alexandre Meyer <pierre@mouraf.org> / 2009-10-31T22:32:26Z-0700
git-committer:
Erwan Velu <erwan.velu@free.fr> / 2009-11-01T13:05:07Z+0100
Message:

hdt: change remaining printf to more_printf (CLI)

A lot of places still had printf() instead of more_printf().
This patch does a bulk update and add missing reset_more_printf(),
used to reset the pager counter between each command call.

This also changes the more_printf() routine to delete the "--More--"
line while scrolling.

Signed-off-by: Pierre-Alexandre Meyer <pierre@…>

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • com32/hdt/hdt-cli-hdt.c

    ra7f6dd rdff898  
    5353        int i = 0; 
    5454 
    55         printf("Available modes:\n"); 
     55    reset_more_printf(); 
     56        more_printf("Available modes:\n"); 
    5657        while (list_modes[i]) { 
    57                 printf("%s ", list_modes[i]->name); 
     58                more_printf("%s ", list_modes[i]->name); 
    5859                i++; 
    5960        } 
    60         printf("\n"); 
     61        more_printf("\n"); 
    6162} 
    6263 
     
    7172        cli_mode_t new_mode; 
    7273 
     74    reset_more_printf(); 
    7375        if (argc <= 0) { 
    74                 printf("Which mode?\n"); 
     76                more_printf("Which mode?\n"); 
    7577                return; 
    7678        } 
     
    118120        find_cli_mode_descr(hdt_cli.mode, &current_mode); 
    119121 
    120         printf("Available commands are:\n"); 
     122    reset_more_printf(); 
     123        more_printf("Available commands are:\n"); 
    121124 
    122125        /* List first default modules of the mode */ 
     
    124127            current_mode->default_modules->modules) { 
    125128                while (current_mode->default_modules->modules[j].name) { 
    126                         printf("%s ", 
     129                        more_printf("%s ", 
    127130                               current_mode->default_modules->modules[j].name); 
    128131                        j++; 
    129132                } 
    130                 printf("\n"); 
     133                more_printf("\n"); 
    131134        } 
    132135 
     
    134137        if (current_mode->show_modules && 
    135138            current_mode->show_modules->modules) { 
    136                 printf("\nshow commands:\n"); 
     139                more_printf("\nshow commands:\n"); 
    137140                j = 0; 
    138141                while (current_mode->show_modules->modules[j].name) { 
    139                         printf("%s ", 
     142                        more_printf("%s ", 
    140143                               current_mode->show_modules->modules[j].name); 
    141144                        j++; 
    142145                } 
    143                 printf("\n"); 
     146                more_printf("\n"); 
    144147        } 
    145148 
     
    147150        if (current_mode->set_modules && 
    148151            current_mode->set_modules->modules) { 
    149                 printf("\nset commands:\n"); 
     152                more_printf("\nset commands:\n"); 
    150153                j = 0; 
    151154                while (current_mode->set_modules->modules[j].name) { 
    152                         printf("%s ", 
     155                        more_printf("%s ", 
    153156                               current_mode->set_modules->modules[j].name); 
    154157                        j++; 
    155158                } 
    156                 printf("\n"); 
     159                more_printf("\n"); 
    157160        } 
    158161 
     
    174177                                             &associated_module); 
    175178                        if (associated_module == NULL) 
    176                                 printf("%s ", 
     179                                more_printf("%s ", 
    177180                                       hdt_mode.default_modules->modules[j].name); 
    178181                        j++; 
    179182                } 
    180                 printf("\n"); 
    181         } 
    182  
    183         printf("\n"); 
     183                more_printf("\n"); 
     184        } 
     185 
     186        more_printf("\n"); 
    184187        main_show_modes(argc, argv, hardware); 
    185188} 
     
    207210        detect_dmi(hardware); 
    208211        cpu_detect(hardware); 
     212    reset_more_printf(); 
    209213        clear_screen(); 
    210214        main_show_cpu(argc, argv, hardware); 
     
    237241                   struct s_hardware *hardware __unused) 
    238242{ 
    239         printf("HDT\n"); 
    240         printf(" Product     : %s\n", PRODUCT_NAME); 
    241         printf(" Version     : %s\n", VERSION); 
    242         printf(" Author      : %s\n", AUTHOR); 
    243         printf(" Contact     : %s\n", CONTACT); 
     243    reset_more_printf(); 
     244        more_printf("HDT\n"); 
     245        more_printf(" Product     : %s\n", PRODUCT_NAME); 
     246        more_printf(" Version     : %s\n", VERSION); 
     247        more_printf(" Author      : %s\n", AUTHOR); 
     248        more_printf(" Contact     : %s\n", CONTACT); 
    244249        char *contributors[NB_CONTRIBUTORS] = CONTRIBUTORS; 
    245250        for (int c = 0; c < NB_CONTRIBUTORS; c++) { 
    246                 printf(" Contributor : %s\n", contributors[c]); 
     251                more_printf(" Contributor : %s\n", contributors[c]); 
    247252        } 
    248253}