util/flash_jlink.py: Fix formatting + parsing convention
BRANCH=none
TEST=./util/flash_jlink.py --jlink JLinkExe --ip blah
# Ensure that the blah parameter was passed
@@ -62,7 +62,8 @@ def flash(jlink_exe, ip, device, interface, cmd_file):
subprocess.run(cmd)
-def main():
+def main(argv: list):
+
parser = argparse.ArgumentParser()
default_jlink = './JLink_Linux_V670e_x86_64/JLinkExe'
@@ -97,7 +98,7 @@ def main():
default='DEBUG'
)
- args = parser.parse_args()
+ args = parser.parse_args(argv)
logging.basicConfig(level=args.log_level)
if args.board not in BOARD_CONFIGS:
@@ -115,4 +116,4 @@ def main():
if __name__ == '__main__':
- sys.exit(main())
+ sys.exit(main(sys.argv[1:]))
