TableEmptyMessage attribute#5641
Conversation
| use Attribute; | ||
|
|
||
| #[Attribute(Attribute::TARGET_METHOD)] | ||
| class TableEmptyMessage extends \Consolidation\AnnotatedCommand\Attributes\TableEmptyMessage |
There was a problem hiding this comment.
It seems really unfortunate that we need to duplicate all of the attributes in the \Consolidation\AnnotatedCommand\Attributes namespace here.
There was a problem hiding this comment.
I've accepted it in favor of having one namespace to autocomplete attribute names in an IDE. Custom code is welcome to use AC attributes directly as https://github.com/drush-ops/drush/blob/12.x/tests/fixtures/lib/Drush/Commands/ExampleAttributesDrushCommands.php#L80-L95 does.
be3914b to
b1f3c31
Compare
| ])] | ||
| #[CLI\DefaultTableFields(fields: ['package', 'display_name', 'status', 'version'])] | ||
| #[CLI\FilterDefaultField(field: 'display_name')] | ||
| #[CLI\TableEmptyMessage(message: 'There are no items to list')] |
There was a problem hiding this comment.
Run drush pm:list --filter=package=Core to see a list of core modules; run drush pm:list --filter=package=Foo to see the empty message.
| use Attribute; | ||
|
|
||
| #[Attribute(Attribute::TARGET_METHOD)] | ||
| class TableEmptyMessage extends \Consolidation\AnnotatedCommand\Attributes\TableEmptyMessage |
There was a problem hiding this comment.
I've accepted it in favor of having one namespace to autocomplete attribute names in an IDE. Custom code is welcome to use AC attributes directly as https://github.com/drush-ops/drush/blob/12.x/tests/fixtures/lib/Drush/Commands/ExampleAttributesDrushCommands.php#L80-L95 does.
|
Looks like consolidation/annotated-command#303 needs to get merged still @greg-1-anderson |
If this looks okay, then we can merge consolidation/annotated-command#303 and consolidation/output-formatters#108 and make releases.
Feel fee to comment on those PRs if you have any comments on naming things, or any other detail.