From a643699b7b9e6ab2be0815b9e2f7b62730b7a682 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Aug 2024 20:52:54 -0400 Subject: [PATCH] display ">100%" when past maxsize This is to avoid a value like 1000% causing the table to not align. --- Command/MaxSize.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Command/MaxSize.hs b/Command/MaxSize.hs index 80f9c63fd0..58684311b6 100644 --- a/Command/MaxSize.hs +++ b/Command/MaxSize.hs @@ -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%" _ -> "" , "" ]