mdict-hs/cli-example/Main.hs
hashirama 56ad7ab61c Update cli-example/Main.hs
Signed-off-by: hashirama <hashirama@noreply.localhost>
2026-01-20 01:48:32 +00:00

19 lines
449 B
Haskell

{-# LANGUAGE OverloadedStrings #-}
import System.Environment (getArgs)
import System.Exit (exitFailure)
import Control.Monad (when)
import MDict (lookupInCollection)
main :: IO ()
main = do
args <- getArgs
when (length args < 2) $ do
putStrLn "Usage: Main <dictionary_dir> <query_key>"
exitFailure
let dictDir = args !! 0
queryKey = args !! 1
-- Process all files
lookupInCollection dictDir queryKey