initial commit

This commit is contained in:
2025-08-01 18:44:48 +09:00
commit d0e1d01de1
20 changed files with 542 additions and 0 deletions

22
app/Main.hs Normal file
View File

@@ -0,0 +1,22 @@
module Main (main) where
import OneCommand.Prelude (generateOneCommand)
import System.Environment (getArgs)
import OneCommand.Mcm.Parser (processDir)
import GHC.IO.Handle.Text (hPutStrLn)
import GHC.IO.Handle.FD (stderr)
import Control.Monad.Except (runExceptT)
main :: IO ()
main = do
args <- getArgs
let dir = case args of
[d] -> d
_ -> "."
result <- runExceptT $ processDir dir
case result of
Right c -> do
let ocmd = generateOneCommand c
putStrLn ocmd
Left err -> hPutStrLn stderr err