wip, fixme-new dump command

This commit is contained in:
Dmitry Zuikov 2024-08-30 12:01:04 +03:00
parent 2c8d4001b0
commit ec4f9b6dce
2 changed files with 14 additions and 0 deletions

View File

@ -229,6 +229,12 @@ runTop forms = do
_ -> throwIO $ BadFormException @C nil
entry $ bindMatch "dump" $ nil_ \case
[FixmeHashLike h] -> do
lift $ dumpFixme h
_ -> throwIO $ BadFormException @C nil
entry $ bindMatch "cat" $ nil_ \case
[SymbolVal "metadata", FixmeHashLike hash] -> do
lift $ catFixmeMetadata hash

View File

@ -249,6 +249,14 @@ catFixmeMetadata = cat_ True
catFixme :: FixmePerks m => Text -> FixmeM m ()
catFixme = cat_ False
dumpFixme :: FixmePerks m => Text -> FixmeM m ()
dumpFixme hash = do
flip runContT pure do
mha <- lift $ selectFixmeHash hash
ha <- ContT $ maybe1 mha (pure ())
fme' <- lift $ selectFixme ha
liftIO $ print $ pretty fme'
cat_ :: FixmePerks m => Bool -> Text -> FixmeM m ()
cat_ metaOnly hash = do