module CLI ( argParser , Config(..) ) where import System.Console.ArgParser data Config = Build FilePath Bool | Watch FilePath Bool | New String deriving (Show) argParser :: IO (CmdLnInterface Config) argParser = mkSubParser [ ( "build" , mkDefaultApp (Build `parsedBy` optPos "." "directory" `andBy` boolFlag "drafts") "build" ) , ( "watch" , mkDefaultApp (Watch `parsedBy` optPos "." "directory" `andBy` boolFlag "drafts") "watch" ) , ("new", mkDefaultApp (New `parsedBy` reqPos "name") "new") ]