From a6f4a5a1fab9dd2fc56c3fc06a35b670750cdacc Mon Sep 17 00:00:00 2001 From: voidlizard Date: Fri, 17 Jan 2025 11:19:14 +0300 Subject: [PATCH] wip --- hbs2-git3/app/GitRemoteHelper.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hbs2-git3/app/GitRemoteHelper.hs b/hbs2-git3/app/GitRemoteHelper.hs index 45644bf2..0346df62 100644 --- a/hbs2-git3/app/GitRemoteHelper.hs +++ b/hbs2-git3/app/GitRemoteHelper.hs @@ -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