-
-
Notifications
You must be signed in to change notification settings - Fork 7k
CLI: Add --version to CLI option #7549
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
I added to get the Arduino IDE version from the command line It will allow to check easily if the new Arduino is already installed. This feature makes it easier to build external systems linked to specific versions of Arduino. 1. I added `--version` action, which shows version name and exit 1. Currently, VERSION_NAME_LONG (like `1.8.5`, `1.9.0-beta`, `1.8.6 Hourly Build XXX`, etc...) is used. Because I want to know its version number and stable/beta/hourly. 2. Finish with `0`. Because it is `SUCCESSFLLY FINISHED`. 2. Updated man page.
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.
Adding --version
sounds like a good idea, but I left one comment about where to implement it.
@@ -84,6 +85,10 @@ public void parseArgumentsPhase1() { | |||
} | |||
libraryToInstall = args[i]; | |||
} | |||
if (a == ACTION.VERSION) { | |||
BaseNoGui.showMessage("Arduino", BaseNoGui.VERSION_NAME_LONG); | |||
System.exit(0); |
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'm not sure I like this exit here, this bypasses any cleanup that would normally (perhaps) run after this function returns. Also, this function is expected to parse arguments only, not act on them. Also, passing --version --verify
now just acts on --version
, instead of showing an error that only one of them can be passed.
Better would seem to set action
here, and act on it elsewhere.
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.
You're right!
Thank you for your comment.
Move print action to probably suitable place. This commit will fix the behavior of multiple actions about --version.
@matthijskooijman Is this better with the changes? |
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.
Thank you, reviewers! |
I added to get the Arduino IDE version from the command line
It will allow to check easily if the new Arduino is already installed.
This feature makes it easier to build external systems linked to specific versions of Arduino.
--version
action, which shows version name and exit1.8.5
,1.9.0-beta
,1.8.6 Hourly Build XXX
, etc...) is used. Because I want to know its version number and stable/beta/hourly.0
. Because it isSUCCESSFLLY FINISHED
.