forked from hashirama/mdict-hs
19 lines
449 B
Haskell
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
|