Browse Source

scripts: west: commands: make use of shield.yml in west shields command

This change introduces the use of shield.yml in the `west shields`
command so that when using the `-f` option one can output the shields'
full name and vendor information.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
pull/90404/head
Benjamin Cabé 2 months ago committed by Benjamin Cabé
parent
commit
df01afa8c6
  1. 9
      scripts/west_commands/shields.py

9
scripts/west_commands/shields.py

@ -49,6 +49,8 @@ class Shields(WestCommand): @@ -49,6 +49,8 @@ class Shields(WestCommand):
The following arguments are available:
- name: shield name
- full_name: shield full name (typically, its commercial name)
- vendor: shield vendor
- dir: directory that contains the shield definition
'''))
@ -82,4 +84,9 @@ class Shields(WestCommand): @@ -82,4 +84,9 @@ class Shields(WestCommand):
for shield in list_shields.find_shields(args):
if name_re is not None and not name_re.search(shield.name):
continue
self.inf(args.format.format(name=shield.name, dir=shield.dir))
self.inf(args.format.format(
name=shield.name,
dir=shield.dir,
vendor=shield.vendor if hasattr(shield, 'vendor') else '',
full_name=shield.full_name if hasattr(shield, 'full_name') else shield.name
))

Loading…
Cancel
Save