From 748c60f318b6a68b1c424db1310ee0268f1ccb35 Mon Sep 17 00:00:00 2001 From: James Clarke Date: Tue, 10 Dec 2024 13:59:22 +0000 Subject: [PATCH] Add optional argument to workbench main() Then someone can pass in arguments directly instead of using sys.argv. If no arguments are given then sys.argv gets used by default. Co-authored-by: Thomas Hampson --- qt/applications/workbench/workbench/app/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt/applications/workbench/workbench/app/main.py b/qt/applications/workbench/workbench/app/main.py index 04ff1604257d..7378faa864d7 100644 --- a/qt/applications/workbench/workbench/app/main.py +++ b/qt/applications/workbench/workbench/app/main.py @@ -12,7 +12,7 @@ import warnings -def main(): +def main(args=None): # setup command line arguments parser = argparse.ArgumentParser(description="Mantid Workbench") parser.add_argument("script", nargs="?") @@ -45,7 +45,7 @@ def main(): pass # silently skip this # parse the command line options - options = parser.parse_args() + options = parser.parse_args(args=args) if options.error_on_warning: warnings.simplefilter("error") # Change the filter in this process