display ">100%" when past maxsize

This is to avoid a value like 1000% causing the table to not align.
This commit is contained in:
Joey Hess 2024-08-21 20:52:54 -04:00
parent 76ece2a699
commit a643699b7b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -98,7 +98,7 @@ sizeOverview o = do
(widths, headers) = unzip
[ (7, "size")
, (7, "maxsize")
, (5, "%full")
, (6, "%full")
, (0, "repository")
]
@ -109,9 +109,11 @@ sizeOverview o = do
[ formatsize size
, formatsize maxsize
, case (size, maxsize) of
(Just size', Just maxsize') ->
showPercentage 0 $
percentage maxsize' size'
(Just size', Just maxsize')
| size' <= maxsize' ->
showPercentage 0 $
percentage maxsize' size'
| otherwise -> ">100%"
_ -> ""
, ""
]