Add cli arg for config file
This commit is contained in:
parent
59e33da9a6
commit
fe17378bb0
9 changed files with 18 additions and 13 deletions
|
@ -10,6 +10,7 @@ import tempfile
|
|||
|
||||
parser = argparse.ArgumentParser(description="Run swash model")
|
||||
parser.add_argument("-v", "--verbose", action="count", default=0)
|
||||
parser.add_argument("-c", "--config", default="config.ini")
|
||||
args = parser.parse_args()
|
||||
|
||||
logging.basicConfig(level=max((10, 20 - 10 * args.verbose)))
|
||||
|
@ -17,7 +18,7 @@ log = logging.getLogger("swash")
|
|||
|
||||
log.info("Starting swash model")
|
||||
config = configparser.ConfigParser()
|
||||
config.read("config.ini")
|
||||
config.read(args.config)
|
||||
|
||||
inp = pathlib.Path(config.get("swash", "input"))
|
||||
out = pathlib.Path(config.get("swash", "out"))
|
||||
|
|
Reference in a new issue