aboutsummaryrefslogtreecommitdiffstats
path: root/app/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'app/Main.hs')
-rw-r--r--app/Main.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/app/Main.hs b/app/Main.hs
index 7c0e748..d757292 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -334,7 +334,8 @@ module Main where
import Control.Applicative ((<|>))
import Data.Function ((&))
-import Data.List (find, intersperse)
+import Data.List (intersperse)
+import Data.Map qualified as M
import Data.Text qualified as T
import Data.Text.IO qualified as T
import Data.Text.Lazy qualified as LT
@@ -517,7 +518,7 @@ idArg =
( O.metavar "ID"
<> O.completer
( O.listIOCompleter $
- map (T.unpack . I.id) . (.issues)
+ map T.unpack . M.keys . (.issues)
<$> getHistory
)
)
@@ -552,7 +553,7 @@ main = do
. I.applyFilters filters
. I.applyPath files
. I.applyClosed closed
- . (.issues)
+ . (M.elems . (.issues))
<$> getHistory
let groupedIssues = I.groupIssuesByTag group ungroupedIssues
putDoc colorize noPager width (group, groupedIssues)
@@ -562,7 +563,7 @@ main = do
. I.applyFilters filters
. I.applyPath files
. I.applyClosed closed
- . (.issues)
+ . (M.elems . (.issues))
<$> getHistory
putDoc colorize noPager width . (P.vsep . intersperse "") $
map (if detailed then (P.render . P.Detailed) else (P.render . P.Summarized)) issues
@@ -575,7 +576,7 @@ main = do
Options {colorize, noPager, width, command = Show {id, edit}} -> do
issues <- (.issues) <$> getHistory
issue <-
- case find ((==) id . T.unpack . I.id) issues of
+ case M.lookup (T.pack id) issues of
Nothing -> die (printf "no issue with id `%s'\n" id)
Just issue -> pure issue
if edit
@@ -586,7 +587,7 @@ main = do
hClose h
sh_ (proc "${EDITOR-vi} -- %" fp)
I.replaceText issue =<< T.readFile fp
- else putDoc colorize noPager width $ showIssue issues issue
+ else putDoc colorize noPager width $ showIssue (M.elems issues) issue
Options {colorize, noPager, width, internalTags, command = Tags} -> do
issues <- (.issues) <$> getHistory
let tags =