aboutsummaryrefslogtreecommitdiffstats
path: root/app/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'app/Main.hs')
-rw-r--r--app/Main.hs19
1 files changed, 11 insertions, 8 deletions
diff --git a/app/Main.hs b/app/Main.hs
index 630ba89..723a0a1 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -32,13 +32,6 @@
-- Additionally to TODO, also FIXME should start an issue. There might
-- be more interesting keywords.
--- TODO Add tags
---
--- Users can add tags inside issue title and description. Tags are slugs
--- and start with @
---
--- @assigned aforemny
-
-- TODO Add filter by tags
--
-- Users can filter issues for tags with the option -t/--tag @tag.
@@ -57,9 +50,11 @@ import Data.List (intercalate)
import Data.Maybe (catMaybes)
import Data.Maybe qualified as Maybe
import Data.String qualified as String
+import Data.Text qualified as T
import Data.Text.IO qualified as T
import Issue (Issue (..))
import Issue qualified as I
+import Issue.Tag qualified as I
import Options.Applicative ((<**>))
import Options.Applicative qualified as O
import System.Exit (ExitCode (ExitFailure), exitWith)
@@ -134,7 +129,15 @@ showMatches issue = do
listMatches :: Issue -> IO ()
listMatches issue =
- T.putStrLn issue.title
+ printf
+ "%s%s\n"
+ issue.title
+ ( if null issue.tags
+ then ""
+ else
+ T.append " " . T.intercalate " " $
+ map (\(I.Tag k v) -> T.intercalate ":" [k, v]) issue.tags
+ )
data UnknownFileExtension = UnknownFileExtension
{ extension :: String