-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set the command help #37
Comments
Ah, I had put it in the wrong spot, it needs to be set in configure() public function configure(): void
{
$this->setHelp("This is the help for my:command");
} |
What do you think about a class attribute for help, so as to avoid calling this, #[AsCommand('my:command', 'From the extra-console documentation')]
#[CommandHelp(help: 'This is the help for my:command']
final class MyCommand extends InvokableServiceCommand Of course, looking at this I have to wonder if this shouldn't just be added to the AsCommand attribute. With an attribute in this class, what about having the option of passing in a filename? Symfony puts the help in separate files: |
Yeah, that could indeed be useful! |
What do you think about proposing for #[AsCommand('my:command', help: __DIR__.'/..')] |
Symfony's make:crud shows some help lines at the bottom, how is that set in an invokable command? I tried adding this to __invoke, but it didn't seem to work (although again, it might be related to lazy-loading).
The text was updated successfully, but these errors were encountered: