aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Issue/GroupBy.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/Issue/GroupBy.hs b/app/Issue/GroupBy.hs
index 0e8941f..0754e68 100644
--- a/app/Issue/GroupBy.hs
+++ b/app/Issue/GroupBy.hs
@@ -13,9 +13,6 @@ import Issue.Tag (Tag (..))
import Issue.Tag qualified as I
import Options.Applicative qualified as O
-
--- FIXME Parse group by using @topic syntax
-
-- TODO Display number of issues within one group
--
-- ```
@@ -41,12 +38,17 @@ import Options.Applicative qualified as O
groupByArg :: O.Parser (Maybe T.Text)
groupByArg =
O.optional
- ( O.strOption
+ ( O.option
+ (O.maybeReader (parse . T.pack))
( O.long "group-by"
<> O.metavar "TAG"
<> O.help "Group selected issues."
)
)
+ where
+ parse s
+ | "@" `T.isPrefixOf` s = Just (T.drop 1 s)
+ | otherwise = Nothing
groupIssuesBy :: T.Text -> [Issue] -> Map T.Text [Issue]
groupIssuesBy groupBy issues =