From 0ef96e1a437a31346bfb2c1760deb1befb448af0 Mon Sep 17 00:00:00 2001 From: Kevin Velghe Date: Wed, 16 Apr 2025 17:22:35 +0200 Subject: [PATCH] fix boolean command line arguments The default value when using `store_true` is `False`. As a result this will always overwrite any value set in the config file. This fixes this and will only overwrite a potential value in the config file when using the flag. --- ms2rescore/__main__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ms2rescore/__main__.py b/ms2rescore/__main__.py index a3b4ae9..659abf8 100644 --- a/ms2rescore/__main__.py +++ b/ms2rescore/__main__.py @@ -150,6 +150,7 @@ def _argument_parser() -> argparse.ArgumentParser: "--write-report", # metavar="BOOL", action="store_true", + default=None, dest="write_report", help="boolean to enable profiling with cProfile", ) @@ -157,6 +158,7 @@ def _argument_parser() -> argparse.ArgumentParser: "--profile", # metavar="BOOL", action="store_true", + default=None, # type=bool, # dest="profile", help="boolean to enable profiling with cProfile",