Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/terminal/main.c

    r06d0c81 rce862ac  
    11/*
    2  * Copyright (c) 2020 Jiri Svoboda
     2 * Copyright (c) 2021 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3333 */
    3434
     35#include <ui/ui.h>
    3536#include <stdio.h>
    36 #include <task.h>
    37 #include <ui/ui.h>
    3837#include "terminal.h"
    3938
     
    4544        printf("Syntax: %s [<options>]\n", NAME);
    4645        printf("\t-d <display-spec> Use the specified display\n");
     46        printf("\t-c <command>      Run command instead of shell\n");
    4747        printf("\t-topleft]         Place window to the top-left corner of "
    4848            "the screen\n");
     
    5252{
    5353        const char *display_spec = UI_DISPLAY_DEFAULT;
     54        const char *command = "/app/bdsh";
    5455        terminal_t *terminal = NULL;
    5556        terminal_flags_t flags = 0;
     
    6869
    6970                        display_spec = argv[i++];
     71                } else if (str_cmp(argv[i], "-c") == 0) {
     72                        ++i;
     73                        if (i >= argc) {
     74                                printf("Argument missing.\n");
     75                                print_syntax();
     76                                return 1;
     77                        }
     78
     79                        command = argv[i++];
    7080                } else if (str_cmp(argv[i], "-topleft") == 0) {
    7181                        ++i;
     
    8393        }
    8494
    85         rc = terminal_create(display_spec, 640, 480, flags, &terminal);
     95        rc = terminal_create(display_spec, 640, 480, flags, command, &terminal);
    8696        if (rc != EOK)
    8797                return 1;
    8898
    89         task_retval(0);
    90         async_manager();
     99        ui_run(terminal->ui);
     100
     101        terminal_destroy(terminal);
    91102        return 0;
    92103}
Note: See TracChangeset for help on using the changeset viewer.