nasa/fprime-tools

Python exception with incorrect command-line arguments

timcanham opened this issue · 0 comments

F´ Version 3.x
Affected Component n/a

Problem Description

When an fprime-util command is executed with an incorrect argument, the Python code generates an unhelpful exception stack:

How to Reproduce

$: fprime-util generate -ut
Traceback (most recent call last):
  File "/xxxx/bin/fprime-util", line 8, in <module>
    sys.exit(main())
  File "/xxxx/lib/python3.8/site-packages/fprime/util/__main__.py", line 14, in main
    return fprime.util.build_helper.utility_entry(args=sys.argv[1:])
  File "/xxxx/lib/python3.8/site-packages/fprime/util/build_helper.py", line 219, in utility_entry
    parsed, cmake_args, make_args, parser, runners = parse_args(args)
  File "/xxxx/lib/python3.8/site-packages/fprime/util/build_helper.py", line 209, in parse_args
    cmake_args, make_args = validate(parsed, unknown)
  File "/xxxx/lib/python3.8/site-packages/fprime/util/build_helper.py", line 115, in validate
    d_args = {
  File "/xxxx/lib/python3.8/site-packages/fprime/util/build_helper.py", line 116, in <dictcomp>
    match.group(1): match.group(2)
AttributeError: 'NoneType' object has no attribute 'group'

Expected Behavior

Should print an error like invalid argument "-ut"