Skip to content

Commit 47e8fd8

Browse files
committed
Add support for @Usage tags
1 parent 803f365 commit 47e8fd8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Commands/ExecCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ protected function configure() {
2626
$this->setDescription($task->getSummary());
2727
$this->setHelp($task->getDescription());
2828

29+
foreach ($task->getUsages() as $usage) {
30+
$this->addUsage($usage);
31+
}
32+
2933
foreach ($task->getArguments() as $argument) {
3034
if (is_a($argument, BuiltInArgument::class)) {
3135
continue;

src/Task.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ public function getCommand(): string {
4545
return str_replace(['_', '\\'], ['-', ':'], $this->callback);
4646
}
4747

48+
public function getUsages(): array {
49+
return $this->docblock->getTagsByName('usage');
50+
}
51+
4852
/**
4953
* Whether the task is exposed as a console command.
5054
*

0 commit comments

Comments
 (0)