Updated examples, added onEnter method to contexts
This commit is contained in:
		@@ -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();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user