diff --git a/examples/simple.php b/examples/simple.php index 6e02f18..95b0749 100644 --- a/examples/simple.php +++ b/examples/simple.php @@ -17,6 +17,7 @@ class MyCommand extends Command class MyContext extends Context { /** + * @command testme * @args * @help Useful test! */ diff --git a/lib/Context.php b/lib/Context.php index 4ed996e..876422f 100644 --- a/lib/Context.php +++ b/lib/Context.php @@ -41,7 +41,8 @@ class Context $info[$key] = $value; } if (count($info)>0) { - $this->addCommand($method->getName(), [$this, $method->getName()], $info); + $cmdName = array_key_exists("command",$info)?$info["command"]:$method->getName(); + $this->addCommand($cmdName, [$this, $method->getName()], $info); } } } @@ -128,4 +129,4 @@ class Context return $this->data; } -} \ No newline at end of file +}