|
27 | 27 | #include <editline.h>
|
28 | 28 | #include <stdlib.h>
|
29 | 29 |
|
30 |
| -constexpr char kInteractiveModePrompt[] = "Stop and restart stack: [Ctrl+_] & [Ctrl+^]\n" |
31 |
| - "Trigger exit(0): [Ctrl+@]\n" |
32 |
| - "Quit Interactive: 'quit()'\n" |
33 |
| - ">>> "; |
| 30 | +constexpr char kInteractiveModeInstruction[] = "╔══════════════════════════════════════════════════════════════════╗\n" |
| 31 | + "║ Interactive Mode ║\n" |
| 32 | + "╠══════════════════════════════════════════════════════════════════╣\n" |
| 33 | + "║ Stop and restart stack: [Ctrl+_] & [Ctrl+^ ] ║\n" |
| 34 | + "║ Trigger exit(0) : [Ctrl+@] ║\n" |
| 35 | + "║ Quit Interactive : 'quit()' or `quit` ║\n" |
| 36 | + "╚══════════════════════════════════════════════════════════════════╝\n"; |
| 37 | +constexpr char kInteractiveModePrompt[] = ">>> "; |
34 | 38 | constexpr char kInteractiveModeHistoryFilePath[] = "/tmp/darwin_framework_tool_history";
|
35 | 39 | constexpr char kInteractiveModeStopCommand[] = "quit()";
|
| 40 | +constexpr char kInteractiveModeStopAlternateCommand[] = "quit"; |
36 | 41 | constexpr char kCategoryError[] = "Error";
|
37 | 42 | constexpr char kCategoryProgress[] = "Info";
|
38 | 43 | constexpr char kCategoryDetail[] = "Debug";
|
@@ -277,6 +282,11 @@ void ENFORCE_FORMAT(3, 0) InteractiveServerLoggingCallback(const char * module,
|
277 | 282 | printf("%s\n", mAdditionalPrompt.Value());
|
278 | 283 | ClearLine();
|
279 | 284 | }
|
| 285 | + |
| 286 | + ClearLine(); |
| 287 | + printf("%s", kInteractiveModeInstruction); |
| 288 | + ClearLine(); |
| 289 | + |
280 | 290 | command = readline(kInteractiveModePrompt);
|
281 | 291 |
|
282 | 292 | // Do not save empty lines
|
@@ -391,7 +401,7 @@ el_status_t ExitFunction()
|
391 | 401 |
|
392 | 402 | bool InteractiveCommand::ParseCommand(char * command, int * status)
|
393 | 403 | {
|
394 |
| - if (strcmp(command, kInteractiveModeStopCommand) == 0) { |
| 404 | + if (strcmp(command, kInteractiveModeStopCommand) == 0 || strcmp(command, kInteractiveModeStopAlternateCommand) == 0) { |
395 | 405 | ExecuteDeferredCleanups();
|
396 | 406 | return NO;
|
397 | 407 | }
|
|
0 commit comments