Updated examples, added onEnter method to contexts

This commit is contained in:
2017-01-29 20:27:17 +01:00
parent ec60970b5d
commit 75c624520d
4 changed files with 47 additions and 16 deletions

View File

@ -36,9 +36,9 @@ $myShell->setPrompt("test>");
// Create an anonymous context and add a command
$ctx = $myShell->createContext("root");
$ctx->addCommand("hello", function () {
echo "Hello World!\n";
});
$ctx->addCommand("hello", function ($who="World") {
echo "Hello {$who}!\n";
}, [ "help"=>"Say hello", "args"=>"who" ]);
// Run the shell
$myShell->run();