11.3.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 61df3d2d authored by Philipp Meyer's avatar Philipp Meyer

Changed options for the input format

parent b00594bd
......@@ -8,7 +8,6 @@ import System.IO
import System.Console.GetOpt
import Control.Monad
import Control.Applicative
import Data.Char (toUpper)
import Parser
import qualified Parser.PNET as PNET
......@@ -40,14 +39,17 @@ startOptions = Options { inputFormat = PNET
options :: [ OptDescr (Options -> Either String Options) ]
options =
[ Option "f" ["format"]
(ReqArg (\arg opt ->
case reads (map toUpper arg) of
[(format, "")] -> Right opt { inputFormat = format }
_ -> Left ("invalid input format `" ++ arg ++ "'\n"))
"FORMAT")
("Input format (possible values=\"pnet\", \"lola\", \"tpn\"\n" ++
" default=\"pnet\")")
[ Option "" ["pnet"]
(NoArg (\opt -> Right opt { inputFormat = PNET }))
"Use the pnet input format"
, Option "" ["lola"]
(NoArg (\opt -> Right opt { inputFormat = LOLA }))
"Use the lola input format"
, Option "" ["tpn"]
(NoArg (\opt -> Right opt { inputFormat = TPN }))
"Use the tpn input format"
, Option "" ["termination"]
(NoArg (\opt -> Right opt { proveTermination = True }))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment