Skip to content

Commit 8a7b71f

Browse files
committed
Add -S/--supported option to mbed target and mbed toolchain to list targets / toolchains matrix #244
1 parent f691c76 commit 8a7b71f

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

mbed/mbed.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,18 +2177,27 @@ def config_(var, value=None, global_cfg=False, unset=False):
21772177
@subcommand('target',
21782178
dict(name='name', nargs='?', help='Default target name. Example: K64F, NUCLEO_F401RE, NRF51822...'),
21792179
dict(name=['-G', '--global'], dest='global_cfg', action='store_true', help='Use global settings, not local'),
2180+
dict(name=['-S', '--supported'], dest='supported', action='store_true', help='Shows supported matrix of targets and toolchains'),
21802181
help='Set or get default target',
21812182
description=(
2182-
"This is an alias to 'mbed config target [--global] [name]'\n"))
2183-
def target_(name=None, global_cfg=False):
2183+
"Set or get default toolchain\n"
2184+
"This is an alias to 'mbed config [--global] target [name]'\n"))
2185+
def target_(name=None, global_cfg=False, supported=False):
2186+
if supported:
2187+
return compile_(supported=supported)
21842188
return config_('target', name, global_cfg=global_cfg)
21852189

21862190
@subcommand('toolchain',
21872191
dict(name='name', nargs='?', help='Default toolchain name. Example: ARM, uARM, GCC_ARM, IAR'),
2192+
dict(name=['-G', '--global'], dest='global_cfg', action='store_true', help='Use global settings, not local'),
2193+
dict(name=['-S', '--supported'], dest='supported', action='store_true', help='Shows supported matrix of targets and toolchains'),
21882194
help='Set or get default toolchain\n\n',
21892195
description=(
2190-
"This is an alias to 'mbed config toolchain [--global] [name]'\n"))
2191-
def toolchain_(name=None, global_cfg=False):
2196+
"Set or get default toolchain\n"
2197+
"This is an alias to 'mbed config [--global] toolchain [name]'\n"))
2198+
def toolchain_(name=None, global_cfg=False, supported=False):
2199+
if supported:
2200+
return compile_(supported=supported)
21922201
return config_('toolchain', name, global_cfg=global_cfg)
21932202

21942203
@subcommand('help',

0 commit comments

Comments
 (0)