| 325 | } |
| 326 | |
| 327 | static void |
| 328 | db_cmd_list(struct command_table *table) |
| 329 | { |
| 330 | struct command *cmd; |
| 331 | int have_subcommands; |
| 332 | |
| 333 | have_subcommands = 0; |
| 334 | LIST_FOREACH(cmd, table, next) { |
| 335 | if (cmd->more != NULL) |
| 336 | have_subcommands++; |
| 337 | db_printf("%-16s", cmd->name); |
| 338 | db_end_line(16); |
| 339 | } |
| 340 | |
| 341 | if (have_subcommands > 0) { |
| 342 | db_printf("\nThe following have subcommands; append \"help\" " |
| 343 | "to list (e.g. \"show help\"):\n"); |
| 344 | LIST_FOREACH(cmd, table, next) { |
| 345 | if (cmd->more == NULL) |
| 346 | continue; |
| 347 | db_printf("%-16s", cmd->name); |
| 348 | db_end_line(16); |
| 349 | } |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | static void |
| 354 | db_command(struct command **last_cmdp, struct command_table *cmd_table, |
no test coverage detected