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