From 0e6c9db771809d5cb40edf1b920409c0495b7a8e Mon Sep 17 00:00:00 2001 From: Mihail Stoyanov Date: Thu, 15 Nov 2018 12:48:54 +0000 Subject: [PATCH 1/2] Don't print location for `mbed config` for easier parsing. --- mbed/mbed.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mbed/mbed.py b/mbed/mbed.py index 7f51c36a..658204de 100755 --- a/mbed/mbed.py +++ b/mbed/mbed.py @@ -3367,9 +3367,10 @@ def main(): very_verbose = pargs.very_verbose verbose = very_verbose or pargs.verbose pathtype = Repo.pathtype(cwd_root) - action('Working path \"%s\" (%s)' % (cwd_root, pathtype)) - if pathtype != "program": - action('Program path \"%s\"' % Program(cwd_root).path) + if not sys.argv[1].lower() in ["config", "cfg", "conf"]: # `mbed config` should be parse-friendly + action('Working path \"%s\" (%s)' % (cwd_root, pathtype)) + if pathtype == "library": + action('Program path \"%s\"' % Program(cwd_root).path) status = pargs.command(pargs) except ProcessException as e: error( From 69a4dd2371c0bde9cd0aeda7c2b27b4ee1ee708e Mon Sep 17 00:00:00 2001 From: Mihail Stoyanov Date: Mon, 11 Feb 2019 15:08:13 +0000 Subject: [PATCH 2/2] Change name of variables based on suggestion --- mbed/mbed.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mbed/mbed.py b/mbed/mbed.py index 658204de..4b99a123 100755 --- a/mbed/mbed.py +++ b/mbed/mbed.py @@ -144,6 +144,8 @@ # a list of public SCM service (github/butbucket) which support http, https and ssh schemas public_scm_services = ['bitbucket.org', 'github.com', 'gitlab.com'] +# commands that don't get the current work path shown +skip_workpath_commands = ["config", "cfg", "conf"] # verbose logging verbose = False @@ -3367,7 +3369,7 @@ def main(): very_verbose = pargs.very_verbose verbose = very_verbose or pargs.verbose pathtype = Repo.pathtype(cwd_root) - if not sys.argv[1].lower() in ["config", "cfg", "conf"]: # `mbed config` should be parse-friendly + if not sys.argv[1].lower() in skip_workpath_commands: action('Working path \"%s\" (%s)' % (cwd_root, pathtype)) if pathtype == "library": action('Program path \"%s\"' % Program(cwd_root).path)