-
Notifications
You must be signed in to change notification settings - Fork 455
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
CLI: Add in support for selective column output #1085
base: develop
Are you sure you want to change the base?
Conversation
Still want to do a little work on this to allow plugins to have a default set of columns and then a |
b90a637
to
4c7528f
Compare
This adds the ability to provide a third argument in the column definition ("name", "type", "extra"). Extra columns will not be shown by the CLI by default, but can be seen by passing an empty list to the CLI (ie, provide no parameters to the `--columns` flag). Otherwise any columns passed to `--columns` will be displayed and no other columns will. If no valid column name are passed to columns, then the normal list of columns (not including extra) will be displayed. All other UIs will need to implement support for the extra column, otherwise they will silently ignore it.
There's now the ability for plugins to say whether a particular column should be displayed or not (although this is for the UI to decide how to interpret). The plugin will still output all data, and it's the UI's job to decide what the user sees based on how it decides to display the data. The CLI will now display all columns except those marked as extra within the plugin (by creating a column with a third boolean parameter set to true). This means that the tree grid is still defined early and ideally should not be altered between runs of a plugin. To display all columns, pass in I'm still not sure I really like this, I skirted actually implementing renderer options because it would be a lot of work to define them properly, they need to be able to take in user input as well as pass data from the plugin itself in this instance, and it would probably have a significant impact on plugins, whereas at the moment this is quite minimal. Still uncertain about the whole thing though (and the way of displaying all columns in the CLI is a little awkward). The good news is it shouldn't impact any other UIs at all. |
Slightly heavier weight classes rather than tuples, but allows greater flexibility and future assignment of new attribtues.
This adds support for selective column output on the CLI. Other UIs are welcome to implement their own features. Still to add to this is the ability for plugins to provide their own list of expected columns (currently, all columns are output by default).