|
1 | 1 | #!/usr/bin/env python
|
2 | 2 |
|
3 |
| -# Copyright (c) 2016 ARM Limited, All Rights Reserved |
| 3 | +# Copyright (c) 2016-2019 ARM Limited, All Rights Reserved |
4 | 4 | # SPDX-License-Identifier: Apache-2.0
|
5 | 5 |
|
6 | 6 | # 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
|
3195 | 3195 | "Gets, sets or unsets mbed tool configuration options.\n"
|
3196 | 3196 | "Options can be global (via the --global switch) or local (per program)\n"
|
3197 | 3197 | "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")) |
3199 | 3199 | def config_(var=None, value=None, global_cfg=False, unset=False, list_config=False):
|
3200 | 3200 | name = var
|
3201 | 3201 | var = str(var).upper()
|
@@ -3252,9 +3252,13 @@ def config_(var=None, value=None, global_cfg=False, unset=False, list_config=Fal
|
3252 | 3252 | action('%s now set as default %s in program "%s"' % (value, name, program.name))
|
3253 | 3253 | else:
|
3254 | 3254 | 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") |
3256 | 3260 | else:
|
3257 |
| - subcommands['config'].error("too few arguments") |
| 3261 | + error("Too few arguments. Run with -h for detailed help") |
3258 | 3262 |
|
3259 | 3263 |
|
3260 | 3264 | # Build system and exporters
|
|
0 commit comments