Improve output formatting
This commit is contained in:
parent
7f5cb64b18
commit
86aab6bb59
@ -32,7 +32,7 @@ import Data.Bifunctor
|
|||||||
import Data.Char
|
import Data.Char
|
||||||
import Data.Either
|
import Data.Either
|
||||||
import Data.Functor
|
import Data.Functor
|
||||||
import Data.List ( intercalate, sortBy )
|
import Data.List ( intercalate, sort )
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import Data.String.Interpolate
|
import Data.String.Interpolate
|
||||||
import Data.Text ( Text )
|
import Data.Text ( Text )
|
||||||
@ -1038,7 +1038,7 @@ printListResult raw lr = do
|
|||||||
in (if raw then [] else [marks])
|
in (if raw then [] else [marks])
|
||||||
++ [ fmap toLower . show $ lTool
|
++ [ fmap toLower . show $ lTool
|
||||||
, T.unpack . prettyVer $ lVer
|
, T.unpack . prettyVer $ lVer
|
||||||
, intercalate "," $ (fmap printTag $ sortBy tagOrd lTag)
|
, intercalate "," $ (fmap printTag $ sort lTag)
|
||||||
, intercalate ","
|
, intercalate ","
|
||||||
$ (if fromSrc then [color' Blue "compiled"] else mempty)
|
$ (if fromSrc then [color' Blue "compiled"] else mempty)
|
||||||
++ (if lStray then [color' Blue "stray"] else mempty)
|
++ (if lStray then [color' Blue "stray"] else mempty)
|
||||||
@ -1049,14 +1049,11 @@ printListResult raw lr = do
|
|||||||
where
|
where
|
||||||
printTag Recommended = color' Green "recommended"
|
printTag Recommended = color' Green "recommended"
|
||||||
printTag Latest = color' Yellow "latest"
|
printTag Latest = color' Yellow "latest"
|
||||||
printTag (Base pvp'') = color' Blue ("base-" ++ T.unpack (prettyPVP pvp''))
|
printTag (Base pvp'') = "base-" ++ T.unpack (prettyPVP pvp'')
|
||||||
printTag (UnknownTag t ) = t
|
printTag (UnknownTag t ) = t
|
||||||
color' = case raw of
|
color' = case raw of
|
||||||
True -> flip const
|
True -> flip const
|
||||||
False -> color
|
False -> color
|
||||||
tagOrd (Base _) _ = LT
|
|
||||||
tagOrd _ (Base _) = GT
|
|
||||||
tagOrd a b = compare a b
|
|
||||||
|
|
||||||
checkForUpdates :: (MonadThrow m, MonadIO m, MonadFail m, MonadLogger m)
|
checkForUpdates :: (MonadThrow m, MonadIO m, MonadFail m, MonadLogger m)
|
||||||
=> GHCupDownloads
|
=> GHCupDownloads
|
||||||
|
Loading…
Reference in New Issue
Block a user