aboutsummaryrefslogtreecommitdiffstats
path: root/app/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'app/Main.hs')
-rw-r--r--app/Main.hs15
1 files changed, 9 insertions, 6 deletions
diff --git a/app/Main.hs b/app/Main.hs
index 163af8e..d6f653c 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -547,7 +547,7 @@ idArg =
O.strArgument
( O.metavar "ID"
<> O.completer
- (O.listIOCompleter $ catMaybes . map I.id . fst <$> getHistory)
+ (O.listIOCompleter $ catMaybes . map I.id . trd3 . last <$> getHistory)
)
editFlag :: O.Parser Bool
@@ -568,7 +568,7 @@ main = do
O.execParser (O.info (options <**> O.helper) O.idm) >>= \case
Options {internalTags, colorize, noPager, width, command = List {sort, filters, files, group = Just group}} -> do
let withinPath issue = if null files then True else any (\file -> file `isPrefixOf` issue.file) files
- ungroupedIssues <- applySorts sort . applyFilters filters . filter withinPath . fst <$> getHistory
+ ungroupedIssues <- applySorts sort . applyFilters filters . filter withinPath . trd3 . last <$> getHistory
let groupedIssues = I.groupIssuesBy group ungroupedIssues
putDoc colorize noPager width
. P.vsep
@@ -608,7 +608,7 @@ main = do
(M.toList groupedIssues)
Options {internalTags, colorize, noPager, width, command = List {sort, filters, files, group = Nothing}} -> do
let withinPath issue = if null files then True else any (\file -> file `isPrefixOf` issue.file) files
- issues <- applySorts sort . applyFilters filters . filter withinPath . fst <$> getHistory
+ issues <- applySorts sort . applyFilters filters . filter withinPath . trd3 . last <$> getHistory
putDoc colorize noPager width . P.vsep $
map
( \issue ->
@@ -629,7 +629,7 @@ main = do
)
issues
Options {colorize, noPager, width, command = Log} -> do
- (_, ess') <- getHistory
+ ess' <- map (\(commitHash, issueEvents, _) -> (commitHash, issueEvents)) <$> getHistory
putDoc colorize noPager width . P.vsep $
concatMap
( \(hash, es') ->
@@ -647,7 +647,7 @@ main = do
)
(reverse ess')
Options {colorize, width, command = Show {id, edit}} -> do
- issues <- fst <$> getHistory
+ issues <- trd3 . last <$> getHistory
issue <-
case find ((==) (Just id) . I.id) issues of
Nothing -> die (printf "no issue with id `%s'\n" id)
@@ -701,7 +701,7 @@ main = do
++ show issue.start.row
++ "\n"
Options {colorize, noPager, width, internalTags, command = Tags} -> do
- issues <- fst <$> getHistory
+ issues <- trd3 . last <$> getHistory
let tags =
concatMap
( \issue ->
@@ -787,3 +787,6 @@ putDoc colorize noPager width doc = do
else LT.putStr s
foreign import ccall "unistd.h isatty" c_isatty :: Int -> IO Int
+
+trd3 :: (a, b, c) -> c
+trd3 (_, _, c) = c