Changeset c0f13d2 in mainline for kernel/generic/src/console/cmd.c


Ignore:
Timestamp:
2010-06-10T16:04:07Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
48dcc69
Parents:
8eec3c8
Message:

introduce more compact and more readable command output to kconsole (suitable even for 80-column screens)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/cmd.c

    r8eec3c8 rc0f13d2  
    207207};
    208208
    209 /* Data and methods for 'call0' command. */
     209/* Data and methods for 'call0' and 'mcall0' command. */
    210210static char call0_buf[MAX_CMDLINE + 1];
    211211static char carg1_buf[MAX_CMDLINE + 1];
     
    363363};
    364364
     365
    365366static int cmd_tasks(cmd_arg_t *argv);
     367static char tasks_buf[MAX_CMDLINE + 1];
     368
     369static cmd_arg_t tasks_argv = {
     370        .type = ARG_TYPE_STRING_OPTIONAL,
     371        .buffer = tasks_buf,
     372        .len = sizeof(tasks_buf)
     373};
    366374static cmd_info_t tasks_info = {
    367375        .name = "tasks",
    368         .description = "List all tasks.",
     376        .description = "List all tasks (use -a for additional information).",
    369377        .func = cmd_tasks,
    370         .argc = 0
     378        .argc = 1,
     379        .argv = &tasks_argv
    371380};
    372381
     
    930939 * @return Always 1
    931940 */
    932 int cmd_tasks(cmd_arg_t * argv)
    933 {
    934         task_print_list();
     941int cmd_tasks(cmd_arg_t *argv)
     942{
     943        if (str_cmp(tasks_buf, "-a") == 0)
     944                task_print_list(true);
     945        else if (str_cmp(tasks_buf, "") == 0)
     946                task_print_list(false);
     947        else
     948                printf("Unknown argument \"%s\".\n", tasks_buf);
     949       
    935950        return 1;
    936951}
Note: See TracChangeset for help on using the changeset viewer.