-
Notifications
You must be signed in to change notification settings - Fork 179
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
Conversation
action('Program path \"%s\"' % Program(cwd_root).path) | ||
if not sys.argv[1].lower() in ["config"]: # `mbed config` should be parse-friendly | ||
action('Working path \"%s\" (%s)' % (cwd_root, pathtype)) | ||
if pathtype == "library": |
There was a problem hiding this comment.
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 !=
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
mbed/mbed.py
Outdated
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"]: # `mbed config` should be parse-friendly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for doing in ["config"]
instead of is "config"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, what happens if a config alias is used instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope the updated PR answers the question :)
93065bc
to
10be76e
Compare
Not sure how the PR got closed... |
Whops, I deleted my own branch, sorry. |
mbed/mbed.py
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this the list of config subcommand names should be a global, so that if I add another alias for config I don't have to add it into two places. You could also remove the comment at that point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what's the proposal? Modify the subcommand routine so for every command there's a list of aliases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make ["config", "cfg", "conf"]
a global variable constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, since I realized my brain fart from last night about the "in" syntax.
However, would like to see this fixed such that the lists don't need to be duplicated to make maintenance less of an issue (aka what @theotherjimmy said). Don't know the urgency of this fix.
This PR will need a rebase to bring in the fixes for the Circle CI configuration. |
59b68d2
to
0e6c9db
Compare
mbed config
for easier parsing.mbed config
for easier parsing.
@MarceloSalazar raised that #780 broke the parser he wrote for
mbed config -G KEY
which is used to extract configuration from Mbed CLI and use with other tools. This PR aims to fix this and restore the old behavior formbed config
.CC @MarceloSalazar