Skip to content

Commit 0f8b66d

Browse files
author
Naveen Kaje
committed
mbed: config: print detailed help in subcommand
Print detailed usage when unsupported arguments are supplied with mbed config subcommand
1 parent fe28953 commit 0f8b66d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

mbed/mbed.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3195,7 +3195,7 @@ def sterm(target=None, port=None, baudrate=None, echo=None, reset=False, sterm=T
31953195
"Gets, sets or unsets mbed tool configuration options.\n"
31963196
"Options can be global (via the --global switch) or local (per program)\n"
31973197
"Global options are always overridden by local/program options.\n"
3198-
"Currently supported options: target, toolchain, protocol, depth, cache, profile"))
3198+
"Currently supported options: target, toolchain, protocol, depth, cache, profile, color"))
31993199
def config_(var=None, value=None, global_cfg=False, unset=False, list_config=False):
32003200
name = var
32013201
var = str(var).upper()
@@ -3252,9 +3252,13 @@ def config_(var=None, value=None, global_cfg=False, unset=False, list_config=Fal
32523252
action('%s now set as default %s in program "%s"' % (value, name, program.name))
32533253
else:
32543254
value = program.get_cfg(var)
3255-
action(('%s' % value) if value else 'No default %s set in program "%s"' % (name, program.name))
3255+
if value:
3256+
action('%s' % value)
3257+
else:
3258+
action('No default %s set in program "%s"' % (name, program.name))
3259+
error("run with -h for detailed usage help")
32563260
else:
3257-
subcommands['config'].error("too few arguments")
3261+
error("Too few arguments. Run with -h for detailed help")
32583262

32593263

32603264
# Build system and exporters

0 commit comments

Comments
 (0)