Skip to content

Feature: Don't print location for mbed config for easier parsing. #790

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

Merged
merged 2 commits into from
Feb 11, 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
9 changes: 6 additions & 3 deletions mbed/mbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -3367,9 +3369,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 skip_workpath_commands:
action('Working path \"%s\" (%s)' % (cwd_root, pathtype))
if pathtype == "library":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this line need to change from == to != ?

Copy link
Contributor Author

@screamerbg screamerbg Nov 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because when you use mbed CLI on a directory that cannot be associated with a project, getting "Program path" message is very confusing - it may not be program at all. Also in the case of folder, the two print statements report the same folder.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kk. Was primarily wondering if some third pathtype was present elsewhere, but that makes sense.

action('Program path \"%s\"' % Program(cwd_root).path)
status = pargs.command(pargs)
except ProcessException as e:
error(
Expand Down