@@ -318,29 +318,13 @@ def complete(message_func, elf0, hexf0, hexf1=None):
318
318
319
319
def merge_action (args ):
320
320
"""Entry point for the "merge" CLI command."""
321
- try :
322
- elf_file = list (pathlib .Path (args .artefacts_location ).glob ("*.elf" ))[0 ]
323
- m4hex_file = list (pathlib .Path (args .artefacts_location ).glob ("*.hex" ))[0 ]
324
- except IndexError :
325
- raise ArtefactsError (
326
- f"Could not find elf and/or hex file in { args .artefacts_location } "
327
- )
328
-
329
321
complete_func (
330
- print , elf_file , m4hex_file , args .m0hex
322
+ print , args . elf , args . m4hex , args .m0hex
331
323
)
332
324
333
325
334
326
def sign_action (args ):
335
327
"""Entry point for the "sign" CLI command."""
336
- try :
337
- elf_file = list (pathlib .Path (args .artefacts_location ).glob ("*.elf" ))[0 ]
338
- m4hex_file = list (pathlib .Path (args .artefacts_location ).glob ("*.hex" ))[0 ]
339
- except IndexError :
340
- raise ArtefactsError (
341
- f"Could not find elf and/or hex file in { args .artefacts_location } "
342
- )
343
-
344
328
sign_hex (
345
329
args .build_dir ,
346
330
args .m0hex_filename ,
@@ -350,8 +334,8 @@ def sign_action(args):
350
334
args .boot_scheme ,
351
335
args .cm0_img_id ,
352
336
args .cm4_img_id ,
353
- elf_file ,
354
- m4hex_file ,
337
+ args . elf ,
338
+ args . m4hex ,
355
339
args .m0hex
356
340
)
357
341
@@ -368,7 +352,10 @@ def parse_args():
368
352
"merge" , help = "Merge Cortex-M4 and Cortex-M0 HEX files."
369
353
)
370
354
merge_subcommand .add_argument (
371
- "--artefacts-location" , required = True , help = "the path to the application artefacts."
355
+ "--elf" , required = True , help = "the application ELF file."
356
+ )
357
+ merge_subcommand .add_argument (
358
+ "--m4hex" , required = True , help = "the path to the Cortex-M4 HEX to merge."
372
359
)
373
360
merge_subcommand .add_argument (
374
361
"--m0hex" , help = "the path to the Cortex-M0 HEX to merge."
@@ -400,7 +387,10 @@ def parse_args():
400
387
"--cm4-img-id" , type = int , help = "the Cortex-M4 image ID."
401
388
)
402
389
sign_subcommand .add_argument (
403
- "--artefacts-location" , required = True , help = "the path to the application artefacts."
390
+ "--elf" , required = True , help = "the application ELF file."
391
+ )
392
+ sign_subcommand .add_argument (
393
+ "--m4hex" , required = True , help = "the path to the Cortex-M4 HEX to merge."
404
394
)
405
395
sign_subcommand .add_argument (
406
396
"--m0hex" , help = "the path to the Cortex-M0 HEX to merge."
0 commit comments