grafana / unused

CLI tool, Prometheus exporter, and Go module to list your unused disks in all cloud providers
Apache License 2.0
52 stars 1 forks source link

cmd/unused: add `-add-column` flag to display disk metadata value in output #13

Closed inkel closed 2 years ago

inkel commented 2 years ago

This PR adds a new -add-column flag that can be indicated more than once that allows to add disk metadata in the output.

For the default table view the output is the following (in brackets are those displayed only in verbose mode):

PROVIDER  DISK  AGE  [PROVIDER_META DISK_META]

If you were to call unused -v -add-column=foobar the output now is:

PROVIDER  DISK  AGE  META:foobar  [PROVIDER_META DISK_META]

Additional -add-column flags will add a new META:$value column to the output.

In the case of the interactive UI, the main disk list currently only shows the disk name. By passing this column it will add the metadata key and value to the list.

inkel commented 2 years ago

This PR sheds some light on the interactive UI and its ugly UI design and code, so there will be an upcoming refactor of that in a different PR.