X-Git-Url: https://git.danieliu.xyz/?p=ekitaihs.git;a=blobdiff_plain;f=Parse.hs;fp=Parse.hs;h=2375c4fb4db8674bc05c4cb66f625081872e40e8;hp=9b9de5796e499e98db6bca580773afa336fff4f2;hb=181b3d6a36a6cb74e355727c71b60f0898191468;hpb=8ac4194b0cf084ed48058c2e0a56717529755ddb diff --git a/Parse.hs b/Parse.hs index 9b9de57..2375c4f 100644 --- a/Parse.hs +++ b/Parse.hs @@ -8,26 +8,16 @@ import Data.Maybe import Data.Either data Options = Options - { optHelp :: Bool - , optColor :: Bool - , optTimeStep :: Int + { optTimeStep :: Int } defaultOptions = Options - { optHelp = False - , optColor = False - , optTimeStep = 50000 + { optTimeStep = 50000 } options :: [OptDescr (Options -> Options)] options = - [ Option ['h'] ["help"] - (NoArg (\opts -> opts { optHelp = True })) - "display's this message" - , Option ['c'] ["color", "colour"] - (NoArg (\opts -> opts { optColor = True })) - "enables color" - , Option ['t'] ["timestep"] + [ Option ['t'] ["timestep"] (ReqArg (\t opts -> opts { optTimeStep = read t :: Int }) "timestep") "sets the simulation time step" ]