Skip to content

[Console] Add documentation for console command attributes #15123

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

Closed
wants to merge 1 commit into from

Conversation

MrYamous
Copy link
Contributor

This is the documentation for #15003.

I don't know if it's necessary to specify that not all properties (like 'help') are supported in the attributes, or if the documentation is clear enough as is. What do you think about it?


// the full command description shown when running the command with
// the "--help" option
->setHelp('This command allows you to create a user...')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please add hidden and aliases in this example too?

app::new-user could be used as an alias in both examples.

Thanks

console.rst Outdated

.. code-block:: php-attributes

// ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the use statement to ConsoleCommand

Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comments, thanks

// ...
protected function configure()
{
$this
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name is missing in this example

console.rst Outdated
name: 'app:create-user',
description: 'Creates a new user.'
hidden: false,
aliases: [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be interesting how to set the help

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, help isn't supported in attributes and the use of setHelp() is necessary.
Should I add it in addition to the attributes?

@MrYamous MrYamous force-pushed the add-console-command-attribute branch from ee18009 to 0af2983 Compare March 19, 2021 12:25
javiereguiluz added a commit that referenced this pull request Feb 9, 2022
This PR was squashed before being merged into the 5.4 branch.

Discussion
----------

[Console] Document AsCommand attribute

Replaces #15123 as it seems stale
Close #15003
Friendly ping `@OskarStark` for original PR review

Commits
-------

7a842f1 [Console] Document AsCommand attribute
@javiereguiluz
Copy link
Member

Closing in favor of #16333. Sorry we didn't merge this one, but we hope to get more contributions from you in the future. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants