Changeset f0d7bd9 in mainline for kernel/generic/src/console/kconsole.c
- Timestamp:
- 2012-07-10T12:32:56Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- aca4a04
- Parents:
- 1e01a35
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/kconsole.c
r1e01a35 rf0d7bd9 43 43 #include <console/chardev.h> 44 44 #include <console/cmd.h> 45 #include <console/prompt.h> 45 46 #include <print.h> 46 47 #include <panic.h> … … 214 215 const char *hint; 215 216 char *output = malloc(MAX_CMDLINE, 0); 216 char display = 'y';217 217 size_t hints_to_show = MAX_TAB_HINTS - 1; 218 218 size_t total_hints_shown = 0; 219 char continue_showing_hints = 'y';219 bool continue_showing_hints = true; 220 220 221 221 output[0] = 0; … … 232 232 if (found > MAX_TAB_HINTS) { 233 233 printf("\nDisplay all %zu possibilities? (y or n)", found); 234 wchar_t display; 234 235 do { 235 236 display = indev_pop_character(indev); 236 237 } while (display != 'y' && display != 'n' && display != 'Y' && display != 'N'); 238 continue_showing_hints = (display == 'y') || (display == 'Y'); 237 239 } 238 240 … … 243 245 cmd_info_t *hlp = list_get_instance(pos, cmd_info_t, link); 244 246 245 if ( display == 'y' || display == 'Y') { /* We are still showing hints */247 if (continue_showing_hints) { 246 248 printf("%s (%s)\n", hlp->name, hlp->description); 247 249 --hints_to_show; … … 249 251 250 252 if (hints_to_show == 0 && total_hints_shown != found) { /* Time to ask user to continue */ 251 printf("--More--"); 252 do { 253 continue_showing_hints = indev_pop_character(indev); 254 if (continue_showing_hints == 'y' || continue_showing_hints == 'Y' 255 || continue_showing_hints == ' ') { 256 hints_to_show = MAX_TAB_HINTS - 1; /* Display a full page again */ 257 break; 258 } 259 260 if (continue_showing_hints == 'n' || continue_showing_hints == 'N' 261 || continue_showing_hints == 'q' || continue_showing_hints == 'Q') { 262 display = 'n'; /* Stop displaying hints */ 263 break; 264 } 265 266 if (continue_showing_hints == '\n') { 267 hints_to_show = 1; /* Show one more hint */ 268 break; 269 } 270 } while (1); 271 272 printf("\r \r"); /* Delete the --More-- option */ 253 continue_showing_hints = console_prompt_more_hints(indev, &hints_to_show); 273 254 } 274 255 }
Note:
See TracChangeset
for help on using the changeset viewer.