From ddb4861554c96d2f3f3734eebc358f78c034da7d Mon Sep 17 00:00:00 2001 From: Fabian Kirchner Date: Fri, 13 Oct 2023 22:51:12 +0200 Subject: only show prov info in show command --- app/Main.hs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'app/Main.hs') diff --git a/app/Main.hs b/app/Main.hs index 334f3ce..5793363 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -88,7 +88,7 @@ import Options.Applicative ((<**>)) import Options.Applicative qualified as O import Prettyprinter qualified as P import Prettyprinter.Render.Terminal qualified as P -import Process (sh, sh_, quote) +import Process (quote, sh, sh_) import System.Exit (ExitCode (ExitFailure), exitWith) import System.FilePath qualified as F import System.Process.Typed qualified as P @@ -178,8 +178,7 @@ main = do ( \issue -> P.hsep ( concat - [ [P.pretty issue.provenance.firstCommit, P.pretty (" " :: String)], - [P.annotate P.bold (P.pretty issue.title)], + [ [P.annotate P.bold (P.pretty issue.title)], map ( \(I.Tag k v) -> P.annotate (P.colorDull P.Yellow) $ @@ -203,6 +202,19 @@ main = do issue.file ++ ":" ++ show issue.start.row + ++ ( case issue.provenance of + Nothing -> + "HEAD" + Just provenance -> + "\nvia " + ++ T.unpack provenance.firstCommit + ++ "\nby " + ++ T.unpack provenance.authorName + ++ " <" + ++ T.unpack provenance.authorEmail + ++ ">\nat " + ++ show provenance.date + ) ++ "\n\n" sh_ ( P.setStdin -- cgit v1.2.3