added flag for not writing environment.json
This commit is contained in:
parent
383ba7507f
commit
c731a0f131
14
app/Main.hs
14
app/Main.hs
@ -202,9 +202,10 @@ loop loopAmount ps env opts = loop' loopAmount 0 ps env
|
||||
loop' loopAmount (curLoop+1) newPlants s
|
||||
|
||||
data CLIOptions = CLIOptions
|
||||
{ environment :: Maybe FilePath
|
||||
, logfile :: FilePath
|
||||
, verbose :: Bool
|
||||
{ environment :: Maybe FilePath
|
||||
, logfile :: FilePath
|
||||
, verbose :: Bool
|
||||
, dumpEnvironment :: Bool
|
||||
}
|
||||
|
||||
cliOptParser :: Parser CLIOptions
|
||||
@ -228,6 +229,11 @@ cliOptParser = CLIOptions
|
||||
<> short 'v'
|
||||
<> help "show 'gui' during process"
|
||||
)
|
||||
<*> switch
|
||||
(long "write-environment"
|
||||
<> short 'w'
|
||||
<> help "write environment used to $PWD/environment.json"
|
||||
)
|
||||
|
||||
cliopts = info (cliOptParser <**> helper)
|
||||
(fullDesc
|
||||
@ -260,7 +266,7 @@ main = do
|
||||
enzs <- randomRs (0,length (possibleEnzymes env) - 1) <$> newStdGen
|
||||
let startPlants = randomGenome 2 enzs (possibleEnzymes env) emptyPlants
|
||||
--writeFile "poison.twopi" $ generateDotFromPoisonTree "poison" 0.5 poisonedTree
|
||||
LBS.writeFile "environment.json" . encode $ env
|
||||
when (dumpEnvironment opts) $ LBS.writeFile "environment.json" . encode $ env
|
||||
when printEverything $ putStr "\ESC[?1049h"
|
||||
loghandle <- openFile (logfile opts) WriteMode
|
||||
putStrLn $ "logging to: " ++ logfile opts
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user