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