sv2v/src/Job.hs

42 lines
1.1 KiB
Haskell
Raw Normal View History

2019-02-26 21:03:49 +01:00
{-# LANGUAGE DeriveDataTypeable #-}
{- sv2v
- Author: Zachary Snow <zach@zachjs.com>
-
- Command line arguments.
-}
module Job where
2019-02-26 21:03:49 +01:00
import System.Console.CmdArgs
data Exclude
= Always
| Interface
| Logic
deriving (Show, Typeable, Data, Eq)
2019-02-26 21:03:49 +01:00
data Job = Job
{ exclude :: [Exclude]
, files :: [FilePath]
, incdir :: [FilePath]
, define :: [String]
2019-02-26 21:03:49 +01:00
} deriving (Show, Typeable, Data)
defaultJob :: Job
defaultJob = Job
{ exclude = [] &= typ "CONV"
&= help
("conversion to exclude (always, interface, logic)"
++ "; can be specified multiple times")
, files = def &= args &= typ "FILES"
, incdir = def &= typDir &= help "add directory to include search path"
, define = def &= typ "NAME[=VALUE]" &= help "define value for compilation"
2019-02-26 21:03:49 +01:00
}
&= program "sv2v"
&= summary "sv2v v0.0.1, (C) Zachary Snow 2019, Tom Hawkins, 2011-2015"
&= details [ "sv2v converts SystemVerilog to Verilog."
, "More info: https://github.com/zachjs/sv2v" ]
readJob :: IO Job
readJob = cmdArgs defaultJob