mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
1e008e449c
commit
a6f4a5a1fa
|
@ -11,6 +11,7 @@ import HBS2.Git3.Import
|
|||
import System.Posix.Signals
|
||||
import System.IO qualified as IO
|
||||
import System.Exit qualified as Exit
|
||||
import System.Environment (getArgs)
|
||||
|
||||
import Data.Config.Suckless.Script
|
||||
|
||||
|
@ -31,6 +32,12 @@ sendLine = liftIO . IO.putStrLn
|
|||
die :: (MonadIO m, Pretty a) => a -> m b
|
||||
die s = liftIO $ Exit.die (show $ pretty s)
|
||||
|
||||
parseCLI :: MonadIO m => m [Syntax C]
|
||||
parseCLI = do
|
||||
argz <- liftIO getArgs
|
||||
parseTop (unlines $ unwords <$> splitForms argz)
|
||||
& either (error.show) pure
|
||||
|
||||
-- parseURL :: String -> Maybe (LWWRefKey 'HBS2Basic)
|
||||
-- parseURL s = eitherToMaybe $ Atto.parseOnly p (BS8.pack s)
|
||||
-- where
|
||||
|
@ -109,6 +116,10 @@ main = flip runContT pure do
|
|||
|
||||
conf <- readLocalConf
|
||||
|
||||
cli <- parseCLI
|
||||
|
||||
notice $ pretty cli
|
||||
|
||||
void $ run dict conf
|
||||
|
||||
recover $ connectedDo do
|
||||
|
|
Loading…
Reference in New Issue