From e8988015e242300a569383aaf0d6c5e30b4ef637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Thu, 5 Oct 2017 16:20:33 +0200 Subject: [PATCH] Add more options to the command line --- soil/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/soil/__init__.py b/soil/__init__.py index 4dde0e7..a9540af 100644 --- a/soil/__init__.py +++ b/soil/__init__.py @@ -2,7 +2,7 @@ import importlib import sys import os -__version__ = "0.9.3" +__version__ = "0.9.4" try: basestring @@ -27,6 +27,10 @@ def main(): help='python module containing the simulation configuration.') parser.add_argument('--module', '-m', type=str, help='file containing the code of any custom agents.') + parser.add_argument('--dry-run', '--dry', action='store_true', + help='Do not store the results of the simulation.') + parser.add_argument('--output', '-o', type=str, + help='folder to write results to. It defaults to the current directory.') args = parser.parse_args() @@ -34,8 +38,8 @@ def main(): sys.path.append(os.getcwd()) importlib.import_module(args.module) - print('Loading config file: {}'.format(args.file)) - simulation.run_from_config(args.file) + print('Loading config file: {}'.format(args.file, args.output)) + simulation.run_from_config(args.file, dump=(not args.dry_run), results_dir=args.output) if __name__ == '__main__':