Tools: added options to board_list.py

make it easier to rebuild all bootloaders for AP_Periph with:

  ./Tools/scripts/board_list.py AP_Periph --per-line | xargs -i ./Tools/scripts/build_bootloaders.py '{}'
This commit is contained in:
Andrew Tridgell 2022-04-11 09:22:21 +10:00
parent eaa62fb490
commit 51fa26c505

View File

@ -181,9 +181,21 @@ AUTOBUILD_BOARDS = BoardList().find_autobuild_boards()
AP_PERIPH_BOARDS = BoardList().find_ap_periph_boards() AP_PERIPH_BOARDS = BoardList().find_ap_periph_boards()
if __name__ == '__main__': if __name__ == '__main__':
import sys import argparse
if len(sys.argv) < 2: parser = argparse.ArgumentParser(description='list boards to build')
print("Usage: board_list.py TARGET")
sys.exit(1) parser.add_argument('target')
parser.add_argument('--per-line', action='store_true', default=False, help='list one per line for use with xargs')
args = parser.parse_args()
board_list = BoardList() board_list = BoardList()
print(sorted(board_list.find_autobuild_boards(sys.argv[1]))) target = args.target
if target == "AP_Periph":
blist = board_list.find_ap_periph_boards()
else:
blist = board_list.find_autobuild_boards(target)
blist = sorted(blist)
if args.per_line:
for b in blist:
print(b)
else:
print(blist)