Skip to content

Commit df01afa

Browse files
committed
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>
1 parent 3a62b17 commit df01afa

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/west_commands/shields.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ def do_add_parser(self, parser_adder):
4949
The following arguments are available:
5050
5151
- name: shield name
52+
- full_name: shield full name (typically, its commercial name)
53+
- vendor: shield vendor
5254
- dir: directory that contains the shield definition
5355
'''))
5456

@@ -82,4 +84,9 @@ def do_run(self, args, _):
8284
for shield in list_shields.find_shields(args):
8385
if name_re is not None and not name_re.search(shield.name):
8486
continue
85-
self.inf(args.format.format(name=shield.name, dir=shield.dir))
87+
self.inf(args.format.format(
88+
name=shield.name,
89+
dir=shield.dir,
90+
vendor=shield.vendor if hasattr(shield, 'vendor') else '',
91+
full_name=shield.full_name if hasattr(shield, 'full_name') else shield.name
92+
))

0 commit comments

Comments
 (0)