You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently CLI table columns are ordered in the order they were defined in the structure. This means that either a new data type has to be created and data copied over meticulously and kept in sync with future changes, or the columns will appear in an unsatisfactory order. The order can be especially problematic when embedding other structures.
There are two benefits to allowing the order to be defined:
No more duplicate data structures and copying over (risk of changes/new data fields not being propagated)
Users can define the column order themselves (it could follow the given --colum flag)
@mafredri A custom parameter like --column="queue,created_at,status" should be a low-hanging fruit to add, but I wanted to ask about your guidance for sorting. Should we preserve the default sorting or take the first column instead? Right now, it defaults to CreatedAt. Thoughts?
@mtojek We don't need to touch row sorting here. My intention with this issue is to focus on programmatic column ordering instead of the current struct field order (we already have a --column flag, btw). So it's enough if we can define our preferred order in cli/mycmd.go.
Maybe we just follow the order specified in cliui.TableFormat(T{}, []string{"first", "second"})?
(Table row sorting can be handled by a separate --order or --sort flag, IMO.)
If we later on support column ordering as given by the user, that's OK too.
Currently CLI table columns are ordered in the order they were defined in the structure. This means that either a new data type has to be created and data copied over meticulously and kept in sync with future changes, or the columns will appear in an unsatisfactory order. The order can be especially problematic when embedding other structures.
There are two benefits to allowing the order to be defined:
--colum
flag)This also came up in #15940 (comment) and is something I'd like to utilize in #16030.
The text was updated successfully, but these errors were encountered: