mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
9f21d78416
commit
3450c97baa
23
bf6/hbs23
23
bf6/hbs23
|
@ -7,9 +7,26 @@
|
||||||
(match *args
|
(match *args
|
||||||
( (list? [sym? store] ...)
|
( (list? [sym? store] ...)
|
||||||
(begin
|
(begin
|
||||||
# (local optdef (kw -g 1 --group-key 1))
|
(local optdef (kw -g 1 --group-key 1))
|
||||||
# (local opts (cli:split optdef ...))
|
(local cli (cli:split optdef ...))
|
||||||
(println "FUCKING STORE " ... ))
|
(local opts (nth 0 cli))
|
||||||
|
(local gk1 (lookup:uw --group-key opts))
|
||||||
|
(local gk2 (lookup:uw -g opts))
|
||||||
|
(local gk (car (filter [fn x . [not [nil? x]]] `[,gk1 ,gk2])))
|
||||||
|
(local fname (head (nth 1 cli)))
|
||||||
|
|
||||||
|
(local kwa `[ ,(if gk [list :gk gk] '() )
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
[local r
|
||||||
|
(if fname
|
||||||
|
(hbs2:tree:metadata:file kwa fname)
|
||||||
|
(hbs2:tree:metadata:stdin kwa))]
|
||||||
|
|
||||||
|
(display r)
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ import Control.Monad.Trans.Maybe
|
||||||
import Control.Monad.Trans.Cont
|
import Control.Monad.Trans.Cont
|
||||||
import Data.ByteString.Lazy qualified as LBS
|
import Data.ByteString.Lazy qualified as LBS
|
||||||
import Data.ByteString.Lazy (ByteString)
|
import Data.ByteString.Lazy (ByteString)
|
||||||
|
import Data.ByteString.Char8 qualified as BS8
|
||||||
import Data.Either
|
import Data.Either
|
||||||
import Data.Set qualified as Set
|
import Data.Set qualified as Set
|
||||||
import Data.HashMap.Strict qualified as HM
|
import Data.HashMap.Strict qualified as HM
|
||||||
|
@ -225,7 +226,10 @@ file-name: "qqq.txt"
|
||||||
metadataCreateMan $ args [kw] $
|
metadataCreateMan $ args [kw] $
|
||||||
entry $ bindMatch "hbs2:tree:metadata:stdin" $ \case
|
entry $ bindMatch "hbs2:tree:metadata:stdin" $ \case
|
||||||
[syn@(ListVal{})] -> do
|
[syn@(ListVal{})] -> do
|
||||||
doCreateMetadataTree mempty syn (liftIO LBS.getContents)
|
_reader <- hIsTerminalDevice stdin >>= \case
|
||||||
|
_ -> pure (liftIO LBS.getContents)
|
||||||
|
|
||||||
|
doCreateMetadataTree mempty syn _reader
|
||||||
|
|
||||||
_ -> throwIO (BadFormException @c nil)
|
_ -> throwIO (BadFormException @c nil)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue