Ticket #10296: noninteractive.patch

File noninteractive.patch, 1.4 KB (added by pulkomandy, 10 years ago)

Dirty patch to improve non-interactive use.

  • src/apps/debugger/controllers/TeamDebugger.cpp

    diff --git a/src/apps/debugger/controllers/TeamDebugger.cpp b/src/apps/debugger/controllers/TeamDebugger.cpp
    index 3226afa..b2118b9 100644
    a b TeamDebugger::_HandleTeamDeleted(TeamDeletedEvent* event)  
    13801380        message, "Do nothing", "Quit", fCommandLineArgc != 0
    13811381            ? "Restart team" : NULL);
    13821382
    1383     if (result == 1)
     1383    if (result == 1 || result == -1)
    13841384        PostMessage(B_QUIT_REQUESTED);
    13851385    else if (result == 2) {
    13861386        _SaveSettings();
  • src/apps/debugger/user_interface/cli/commands/CliQuitCommand.cpp

    diff --git a/src/apps/debugger/user_interface/cli/commands/CliQuitCommand.cpp b/src/apps/debugger/user_interface/cli/commands/CliQuitCommand.cpp
    index def9368..d01ce0a 100644
    a b CliQuitCommand::Execute(int argc, const char* const* argv, CliContext& context)  
    2727    printf("Kill or resume the debugged team?\n");
    2828    for (;;) {
    2929        const char* line = context.PromptUser("(k)ill, (r)esume, (c)ancel? ");
    30         if (line == NULL)
    31             return;
     30        if (line == NULL) {
     31            // Failure to read from the standard input likely means it is
     32            // already gone. This allows using the CLI in non-interactive mode:
     33            // echo -e "save-report\nq"|Debugger -c --team nnn
     34            line = "r";
     35        }
    3236
    3337        BString trimmedLine(line);
    3438        trimmedLine.Trim();