diff options
author | Alexander Foremny <aforemny@posteo.de> | 2023-10-04 11:16:34 +0200 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2023-10-04 11:16:34 +0200 |
commit | 9b5bd101f7c511a9a0dd4a12a5480ff2628f0b50 (patch) | |
tree | 3e71a222dad2959e9da9f09354bd926dfe1f7fc0 /app/Main.hs | |
parent | 13b2faa45ca5df4933619a06d28c42686aea8725 (diff) |
add tags to issues
Diffstat (limited to 'app/Main.hs')
-rw-r--r-- | app/Main.hs | 19 |
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 |