Skip to content

[console] make description the first attribute parameter #60359

Closed
@tacman

Description

@tacman

Description

I think 'description' is the most important and common thing to set when defining an #[Option] or #[Argument]. Now that name works in the expected kabob-case (#60344), I rarely have a need to overwrite it.

The problem is that the word "description" is so long! If it were 'info', perhaps it'd be less cumbersome, but really what I'd like is description to be first. My workaround is to set the name to '', but really I'd like name to be at the end:

Before

    public function __invoke(
        SymfonyStyle $io,
        #[Argument('', 'path file to the CSV files downloaded by app:sync-data')]
        string $path = 'data/cmas.csv',
        #[Argument(description: 'directory for the images when syncing from Google Drive')]
        string $imageDir = 'data/cmas-images',
        #[Option(description: 'Process Google Drive images')]
        bool $images = false,
    ): int {

After

    public function __invoke(
        SymfonyStyle $io,
        #[Argument('path file to the CSV files downloaded by app:sync-data')]
        string $path = 'data/cmas.csv',
        #[Argument('directory for the images when syncing from Google Drive')]
        string $imageDir = 'data/cmas-images',
        #[Option('Process Google Drive images')]
        bool $images = false,
    ): int {

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ❄️ Feature FreezeImportant Pull Requests to finish before the next Symfony "feature freeze"Console

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions