-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Move shell-alias to an annotated command. #2376
Conversation
Use a Return an |
Update: The shell-alias command is like Drush status, with the alias name serving as the key of each row. I pushed a commit that fixes the output formatter per the above explanation. |
Thanks. added a few items to the checklist at top. |
Hm, you are right -- there is an extra array wrapped around the data in AssociativeList. That's not right. The output formatters project will need to expose some formatting options to get those other changes to work. Should be doable. |
I fixed the extra wrapped array in --format=yaml in the upstream. The table formatter already supports removing the dashes; just add |
In the current version of Drush, |
Thats true. I was anticipating the need when we get to pml, for example. |
I looked quickly and the output now has no headers nor a : delimiter between the two columns in the table. It looks unclear where each row cell starts and ends. I'm fine with borders everywhere like the screenshot at http://symfony.com/blog/new-in-symfony-2-7-advanced-table-layouts-for-console-commands. |
Borders everywhere is easy to do; adding the
|
OK thanks. For shell-alias, lets do borders everywhere and column names. Not urgent but I think thats a happy place to get to. |
Don't run You can try |
output-formatters will need some work to support column labels for AssociativeList. |
I thought I saw that lack of wordwrap elsewhere. Thats really annoying IMO. A quick search does not show me other projects that have solved it like we have. |
Yeah, it would be really beneficial to add the Drush wordwrap algorithm to the output-formatters table transformation class. Merge #2373 to unblock this issue. |
Starting simple - filed that feature request at consolidation/output-formatters#31 I also got confused about whether to use AssociativeList or RowsOfFields for this command. I think RowsOfFields is correct. Mainly, we need add column headers for the table to make sense to me. |
Perhaps I should have named Whatever it is called, it is definitely the right data structure to use here. A property list is a collection of key : value pairs, with the keys displayed in the first column. By contrast, RowsOfFields is an array of records or rows, each of which are an array of fields (or, perhaps you could think of each record as a PropertyList). If we used RowsOfFields here, then we'd have to manually put the data inside an array (to make a RowOfFields with one row), and there would be no good way to get rid of it again when folks selected --format=yaml et. al. Using AssociativeList / PropertyList here is no impediment to having column headers. We can add these in easily if we wish to do this. All it would take would be a little more metadata in the FormatterOptions that stipulate what the column headers should be labeled. consolidation/output-formatters#33 Finally, the table format always wants to try to convert the raw field / property into a "human readable" label by calling |
…Stopping here for now.
…mmands. Stopping here for now." This reverts commit 987d916.
Wordwrapping has been added to output-formatters |
Todo:
drush shell-alias --format=yaml
has an extra level of grouping that seems unhelpful.