@@ -679,14 +679,16 @@ class DeviceHandler(Handler):
679679 if options .west_runner is not None :
680680 command .append ("--runner" )
681681 command .append (options .west_runner )
682- # There are two ways this option is used.
682+ # There are three ways this option is used.
683683 # 1) bare: --west-flash
684684 # This results in options.west_flash == []
685685 # 2) with a value: --west-flash="--board-id=42"
686686 # This results in options.west_flash == "--board-id=42"
687+ # 3) Multiple values: --west-flash="--board-id=42,--erase"
688+ # This results in options.west_flash == "--board-id=42 --erase"
687689 if options .west_flash != []:
688690 command .append ('--' )
689- command .append (options .west_flash )
691+ command .extend (options .west_flash . split ( ',' ) )
690692 else :
691693 if options .ninja :
692694 generator_cmd = "ninja"
@@ -3056,11 +3058,11 @@ Artificially long but functional example:
30563058 parser .add_argument (
30573059 "--west-flash" , nargs = '?' , const = [],
30583060 help = """Uses west instead of ninja or make to flash when running with
3059- --device-testing.
3061+ --device-testing. Supports comma-separated argument list.
30603062
30613063 E.g "sanitycheck --device-testing --device-serial /dev/ttyACM0
3062- --west-flash="--board-id=foobar"
3063- will translate to "west flash -- --board-id=foobar"
3064+ --west-flash="--board-id=foobar,--erase "
3065+ will translate to "west flash -- --board-id=foobar --erase "
30643066
30653067 NOTE: device-testing must be enabled to use this option.
30663068 """
0 commit comments