icoa-cli 2.19.49 → 2.19.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/repl.js +27 -7
- package/package.json +1 -1
package/dist/repl.js
CHANGED
|
@@ -79,8 +79,8 @@ function printSelectionMenu() {
|
|
|
79
79
|
console.log();
|
|
80
80
|
console.log(chalk.gray(' ─────────────────────────────────────────────'));
|
|
81
81
|
console.log(chalk.white(' demo') + chalk.gray(` ${demoLine}`));
|
|
82
|
-
console.log(chalk.bold.yellow(' exam <token>') + chalk.gray(' Enter exam with access token'));
|
|
83
82
|
console.log(chalk.white(' exam setup') + chalk.gray(' Re-verify tool environment'));
|
|
83
|
+
console.log(chalk.bold.yellow(' exam <token>') + chalk.gray(' Enter exam with access token'));
|
|
84
84
|
console.log(chalk.white(' lang es') + chalk.gray(' Switch language (17 supported)'));
|
|
85
85
|
console.log(chalk.gray(' ─────────────────────────────────────────────'));
|
|
86
86
|
}
|
|
@@ -374,18 +374,38 @@ export async function startRepl(program, resumeMode) {
|
|
|
374
374
|
}
|
|
375
375
|
// Log ALL commands for audit trail
|
|
376
376
|
logCommand(input);
|
|
377
|
-
//
|
|
378
|
-
|
|
379
|
-
|
|
377
|
+
// `exit` — soft exit: acts like `back` and surfaces the menu. Only
|
|
378
|
+
// `quit` / `q` actually close the CLI. Rationale: in the demo flow the
|
|
379
|
+
// user bounces between main prompt and sub-flows (ai4ctf / ctf4ai /
|
|
380
|
+
// demo exam); typing `exit` at the main prompt to mean "leave the demo"
|
|
381
|
+
// is a very common mistake and should never nuke the whole session.
|
|
382
|
+
if (input === 'exit') {
|
|
380
383
|
if (getExamState()) {
|
|
381
384
|
console.log();
|
|
382
|
-
console.log(chalk.yellow(' ⚠
|
|
383
|
-
console.log(chalk.white(' To return to menu without
|
|
384
|
-
console.log(chalk.
|
|
385
|
+
console.log(chalk.yellow(' ⚠ An exam is in progress.'));
|
|
386
|
+
console.log(chalk.white(' To return to menu without losing progress, type: ') + chalk.bold.cyan('back'));
|
|
387
|
+
console.log(chalk.white(' To fully close ICOA CLI, type: ') + chalk.bold.cyan('quit'));
|
|
388
|
+
console.log(chalk.gray(' Your progress is auto-saved either way.'));
|
|
385
389
|
console.log();
|
|
386
390
|
rl.prompt();
|
|
387
391
|
return;
|
|
388
392
|
}
|
|
393
|
+
console.log();
|
|
394
|
+
console.log(chalk.gray(' ') + chalk.white('exit') + chalk.gray(' returns to the main menu. To fully close ICOA CLI, type ') + chalk.bold.cyan('quit') + chalk.gray('.'));
|
|
395
|
+
if (mode === 'selection') {
|
|
396
|
+
printSelectionMenu();
|
|
397
|
+
}
|
|
398
|
+
rl.prompt();
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
// Explicit quit — `quit` or `q` always closes the CLI.
|
|
402
|
+
if (input === 'quit' || input === 'q') {
|
|
403
|
+
if (getExamState()) {
|
|
404
|
+
console.log();
|
|
405
|
+
console.log(chalk.yellow(' ⚠ An exam is in progress — progress is auto-saved.'));
|
|
406
|
+
console.log(chalk.gray(' Closing anyway. Resume with: ') + chalk.white('icoa --resume'));
|
|
407
|
+
console.log();
|
|
408
|
+
}
|
|
389
409
|
stopLogSync();
|
|
390
410
|
recordExit();
|
|
391
411
|
console.log(chalk.gray(' Session saved. Use ') + chalk.white('icoa --resume') + chalk.gray(' to continue.'));
|