From ef6c9270fa3177761f297b5b0c94f1e5d4b07c3c Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Leon Date: Sat, 25 Nov 2023 23:41:36 +0100 Subject: [PATCH] add verbose flag to CLI --- src/moldrug/cli.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/moldrug/cli.py b/src/moldrug/cli.py index 6ca997a..511c3ee 100644 --- a/src/moldrug/cli.py +++ b/src/moldrug/cli.py @@ -23,8 +23,12 @@ def __init__(self, parser) -> None: self.fitness = self.args.fitness self.outdir = self.args.outdir self.continuation = self.args.continuation + self.verbose = self.args.verbose self._set_attributes() + if self.verbose: + os.environ['MOLDRUG_VERBOSE'] = 'True' + def _set_attributes(self): # Get and set configuration self._set_config() @@ -304,7 +308,14 @@ def __moldrug_cmd(): '-v', '--version', action='version', version=f"moldrug: {__version__}") - + parser.add_argument( + '-V', '--verbose', + nargs="?", + dest='verbose', + const=True, + default=False, + type=bool + ) UserArgs = CommandLineHelper(parser) print(