File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -426,10 +426,23 @@ protected function startInteractiveShell(): void
426426 });
427427 }
428428
429+ $ exitKeys = [
430+ 'q ' => 1 ,
431+ 'quit ' => 1 ,
432+ 'exit ' => 1 ,
433+ ];
434+
429435 while (true ) {
430436 $ line = Interact::readln ('<comment>CMD ></comment> ' );
431- if ($ line === 'exit ' || $ line === 'quit ' ) {
432- break ;
437+ if (strlen ($ line ) < 5 ) {
438+ if (isset ($ exitKeys [$ line ])) {
439+ break ;
440+ }
441+
442+ // "?" as show help
443+ if ($ line === '? ' ) {
444+ $ line = 'help ' ;
445+ }
433446 }
434447
435448 if ($ hasPcntl ) {
@@ -444,6 +457,7 @@ protected function startInteractiveShell(): void
444457
445458 // \vdump($in);
446459 $ this ->run (false );
460+ $ out ->println ('' );
447461 }
448462
449463 $ out ->colored ("\nQuit. ByeBye! " );
You can’t perform that action at this time.
0 commit comments