Skip to content

Commit

Permalink
Add optional argument to workbench main()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jclarkeSTFC and thomashampson committed Dec 10, 2024
1 parent e34ccfb commit 748c60f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qt/applications/workbench/workbench/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="?")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 748c60f

Please sign in to comment.