Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mbed: config: print detailed help in subcommand #865

Merged
merged 1 commit into from
Mar 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions mbed/mbed.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

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

# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -3195,7 +3195,7 @@ def sterm(target=None, port=None, baudrate=None, echo=None, reset=False, sterm=T
"Gets, sets or unsets mbed tool configuration options.\n"
"Options can be global (via the --global switch) or local (per program)\n"
"Global options are always overridden by local/program options.\n"
"Currently supported options: target, toolchain, protocol, depth, cache, profile"))
"Currently supported options: target, toolchain, protocol, depth, cache, profile, color"))
def config_(var=None, value=None, global_cfg=False, unset=False, list_config=False):
name = var
var = str(var).upper()
Expand Down Expand Up @@ -3252,9 +3252,13 @@ def config_(var=None, value=None, global_cfg=False, unset=False, list_config=Fal
action('%s now set as default %s in program "%s"' % (value, name, program.name))
else:
value = program.get_cfg(var)
action(('%s' % value) if value else 'No default %s set in program "%s"' % (name, program.name))
if value:
action('%s' % value)
else:
action('No default %s set in program "%s"' % (name, program.name))
error("run with -h for detailed usage help")
else:
subcommands['config'].error("too few arguments")
error("Too few arguments. Run with -h for detailed help")


# Build system and exporters
Expand Down