Skip to content

Commit c9720aa

Browse files
committed
Corrected behavior of mbed -S.
Performed manual tests on mbed-os-5.x.0 repos.
1 parent 937bfa9 commit c9720aa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mbed/mbed.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,7 +2194,7 @@ def status_(ignore=False):
21942194
dict(name=['-c', '--clean'], action='store_true', help='Clean the build directory before compiling'),
21952195
dict(name=['-f', '--flash'], action='store_true', help='Flash the built firmware onto a connected target.'),
21962196
dict(name=['-N', '--artifact-name'], help='Name of the built program or library'),
2197-
dict(name=['-S', '--supported'], dest='supported', const="matrix", choices=["matrix", "toolchains", "targets"], nargs="?", help='Shows supported matrix of targets and toolchains'),
2197+
dict(name=['-S', '--supported'], dest='supported', const=True, choices=["matrix", "toolchains", "targets"], nargs="?", help='Shows supported matrix of targets and toolchains'),
21982198
dict(name='--app-config', dest="app_config", help="Path of an app configuration file (Default is to look for 'mbed_app.json')"),
21992199
help='Compile code using the mbed build tools',
22002200
description=("Compile this program using the mbed build tools."))
@@ -2218,7 +2218,7 @@ def compile_(toolchain=None, target=None, profile=False, compile_library=False,
22182218

22192219
if supported:
22202220
popen([python_cmd, '-u', os.path.join(tools_dir, 'make.py')]
2221-
+ (['-S', supported]) + (['-v'] if very_verbose else [])
2221+
+ (['-S', supported] if (supported is not True) else ['-S']) + (['-v'] if very_verbose else [])
22222222
+ (['--app-config', app_config] if app_config else [])
22232223
+ args,
22242224
env=env)
@@ -2408,7 +2408,7 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False, compi
24082408
dict(name=['-m', '--target'], help='Export for target MCU. Example: K64F, NUCLEO_F401RE, NRF51822...'),
24092409
dict(name='--source', action='append', help='Source directory. Default: . (current dir)'),
24102410
dict(name=['-c', '--clean'], action='store_true', help='Clean the build directory before compiling'),
2411-
dict(name=['-S', '--supported'], dest='supported', const="matrix", choices=["matrix", "ides"], nargs="?", help='Shows supported matrix of targets and toolchains'),
2411+
dict(name=['-S', '--supported'], dest='supported', const=True, choices=['matrix', 'ides'], nargs='?', help='Shows supported matrix of targets and toolchains'),
24122412
dict(name='--app-config', dest="app_config", help="Path of an app configuration file (Default is to look for 'mbed_app.json')"),
24132413
help='Generate an IDE project',
24142414
description=(
@@ -2430,7 +2430,7 @@ def export(ide=None, target=None, source=False, clean=False, supported=False, ap
24302430

24312431
if supported:
24322432
popen([python_cmd, '-u', os.path.join(tools_dir, 'project.py')]
2433-
+ (['-S', supported] if supported else []) + (['-v'] if very_verbose else []),
2433+
+ (['-S', supported] if (supported is not True) else ['-S']) + (['-v'] if very_verbose else []),
24342434
env=env)
24352435
return
24362436

@@ -2574,7 +2574,7 @@ def config_(var=None, value=None, global_cfg=False, unset=False, list_config=Fal
25742574
"This is an alias to 'mbed config [--global] target [name]'\n"))
25752575
def target_(name=None, global_cfg=False, supported=False):
25762576
if supported:
2577-
return compile_(supported='matrix')
2577+
return compile_(supported=supported)
25782578
return config_('target', name, global_cfg=global_cfg)
25792579

25802580
@subcommand('toolchain',
@@ -2587,7 +2587,7 @@ def target_(name=None, global_cfg=False, supported=False):
25872587
"This is an alias to 'mbed config [--global] toolchain [name]'\n"))
25882588
def toolchain_(name=None, global_cfg=False, supported=False):
25892589
if supported:
2590-
return compile_(supported='matrix')
2590+
return compile_(supported=supported)
25912591
return config_('toolchain', name, global_cfg=global_cfg)
25922592

25932593
@subcommand('help',

0 commit comments

Comments
 (0)