From d7dd0277ca33f5592e7bf2e568acc0d006dd7491 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Sat, 4 Jun 2022 20:41:23 -0700 Subject: [PATCH] Update priority for config path Previously, the environment variable would take priority over the command line argument. This is now reversed. Signed-off-by: Alek Ratzloff --- omnibot/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/omnibot/__main__.py b/omnibot/__main__.py index e4b46d3..425dda0 100644 --- a/omnibot/__main__.py +++ b/omnibot/__main__.py @@ -9,7 +9,7 @@ from .config import ServerConfig from .bot import Bot parser = argparse.ArgumentParser(description="Run an IRC bot") -parser.add_argument("-c", "--config", type=str, default="config.toml") +parser.add_argument("-c", "--config", type=str, default=None) parser.add_argument( "--loglevel", type=str, @@ -18,7 +18,7 @@ parser.add_argument( ) args = parser.parse_args() -config_path = Path(os.environ.get("OMNIBOT_CONFIG", args.config)) +config_path = Path(args.config or os.environ.get("OMNIBOT_CONFIG", "config.toml")) config = ServerConfig() try: