Fixed line scrolling, prompt style

This commit is contained in:
2024-02-27 15:03:40 +01:00
parent baff64be7a
commit 17064e7e43
3 changed files with 22 additions and 7 deletions

View File

@ -10,9 +10,11 @@ $shell = new NoccyLabs\React\Shell\Shell();
$commands = new CommandHandler();
$commands->add('help', function ($args, $shell) {
$shell->write("This could be usage help :)\n");
$shell->write("Exit by pressing ^C\n");
});
$commands->on('notfound', function ($command, $shell) {
$shell->write("Command not found: {$command}. Try help\n");
$commands->on('command', function ($command, $args, $shell) {
$shell->write("Bad command '{$command}', try help.\n");
$shell->write("Arguments passed: ".json_encode($args)."\n");
});
$shell->on('prompt', function ($shell) {