Skip to content

Commit 449606f

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 449606f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

mbed/mbed.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
# Copyright (c) 2016 ARM Limited, All Rights Reserved
3+
# Copyright (c) 2016-2019 ARM Limited, All Rights Reserved
44
# SPDX-License-Identifier: Apache-2.0
55

66
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -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)