Skip to content

Add support for totals and improvements to table formatting#5

Open
grdnkln wants to merge 3 commits intopetermaloney:mainfrom
grdnkln:main
Open

Add support for totals and improvements to table formatting#5
grdnkln wants to merge 3 commits intopetermaloney:mainfrom
grdnkln:main

Conversation

@grdnkln
Copy link

@grdnkln grdnkln commented Apr 7, 2025

This PR implements putting totals at the bottom of the tables and to the JSON output.

I also needed to widen the "filename" column for drive names like "drive-tpmstate0-backup" that exceeded the current width which would cause the output to become garbled. Since I was changing the column width, I made it so the column widths can be customized via a variable at the top of the script.

Lastly I added support for automatic human-readable size conversion so it will choose the most appropriate unit e.g. KiB, MiB, GiB, TiB etc., in the output. There is also an argument -u / --units in case you want all the sizes reported in a single unit. Adding "--units MiB" would return the script to it's original behaviour where it outputs all sizes in MiB.

#3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant