@@ -318,29 +318,13 @@ def complete(message_func, elf0, hexf0, hexf1=None):
318318
319319def merge_action (args ):
320320 """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-
329321 complete_func (
330- print , elf_file , m4hex_file , args .m0hex
322+ print , args . elf , args . m4hex , args .m0hex
331323 )
332324
333325
334326def sign_action (args ):
335327 """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-
344328 sign_hex (
345329 args .build_dir ,
346330 args .m0hex_filename ,
@@ -350,8 +334,8 @@ def sign_action(args):
350334 args .boot_scheme ,
351335 args .cm0_img_id ,
352336 args .cm4_img_id ,
353- elf_file ,
354- m4hex_file ,
337+ args . elf ,
338+ args . m4hex ,
355339 args .m0hex
356340 )
357341
@@ -368,7 +352,10 @@ def parse_args():
368352 "merge" , help = "Merge Cortex-M4 and Cortex-M0 HEX files."
369353 )
370354 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."
372359 )
373360 merge_subcommand .add_argument (
374361 "--m0hex" , help = "the path to the Cortex-M0 HEX to merge."
@@ -400,7 +387,10 @@ def parse_args():
400387 "--cm4-img-id" , type = int , help = "the Cortex-M4 image ID."
401388 )
402389 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."
404394 )
405395 sign_subcommand .add_argument (
406396 "--m0hex" , help = "the path to the Cortex-M0 HEX to merge."
0 commit comments