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

Add version of Scala to the output of version command #1262

Merged
merged 2 commits into from Aug 22, 2022

Conversation

lwronski
Copy link
Contributor

@lwronski lwronski commented Aug 17, 2022

I added support for printing info about version of Scala CLI and Scala, the following commands return output:

$ scala-cli --version
Scala CLI version 0.1.11
Default Scala version: 3.1.3
$ scala-cli -version
Scala CLI version 0.1.11
Default Scala version: 3.1.3
$ scala-cli version
Scala CLI version 0.1.11
Default Scala version: 3.1.3

I skipped added support for printing version for the following command:

$ scala-cli -v

now -v allows user to increase verbosity, to avoid double meaning of -v, I skip adding support for this case

@lwronski lwronski force-pushed the version branch 2 times, most recently from 1872ae0 to 5816d2c Compare August 17, 2022 13:58
@lwronski lwronski marked this pull request as ready for review August 17, 2022 14:05
@lwronski lwronski linked an issue Aug 17, 2022 that may be closed by this pull request
Copy link
Contributor

@Gedochao Gedochao left a comment

Choose a reason for hiding this comment

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

We don't have tests for the version sub-command, do we?
I think adding one for SIP mode and one for vanilla Scala CLI might be worth it.
Otherwise, LGTM

@lwronski lwronski requested a review from Gedochao August 18, 2022 11:44
@lwronski lwronski force-pushed the version branch 3 times, most recently from cea76b6 to 49f201a Compare August 19, 2022 09:54
@tanishiking
Copy link

tanishiking commented Aug 19, 2022

Does this PR change the output of scala-cli version too? (edit: never mind, it looks like so 😅 )
If, yes, Metals's ScalaCli support have to update the way to parse the scala-cli's version
https://github.com/scalameta/metals/blob/main/metals/src/main/scala/scala/meta/internal/metals/scalacli/ScalaCli.scala#L192-L205 FYI @tgodzik

@lwronski lwronski force-pushed the version branch 3 times, most recently from a9ad8b7 to 82b77bc Compare August 19, 2022 17:47
@lwronski lwronski merged commit a4cb009 into VirtusLab:main Aug 22, 2022
@tgodzik
Copy link
Member

tgodzik commented Aug 22, 2022

@tanishiking good catch! We need to adjust to it in Metals before the next release.

tgodzik added a commit to tgodzik/metals that referenced this pull request Aug 22, 2022
The change in question is in VirtusLab/scala-cli#1262

This change should future proof Metals
tgodzik added a commit to tgodzik/metals that referenced this pull request Aug 22, 2022
The change in question is in VirtusLab/scala-cli#1262

This change should future proof Metals
@tgodzik
Copy link
Member

tgodzik commented Aug 22, 2022

Does this change makes sense: scalameta/metals#4288 ?

@lwronski
Copy link
Contributor Author

Does this change makes sense: scalameta/metals#4288 ?

Or you can use --cli-version to print plain Scala CLI version:

scala-cli version --cli-version
0.1.11

@tgodzik
Copy link
Member

tgodzik commented Aug 22, 2022

Was --cli-version available in previous versions also?

@lwronski
Copy link
Contributor Author

Was --cli-version available in previous versions also?

No, it will be available from 0.1.12

@tgodzik
Copy link
Member

tgodzik commented Aug 22, 2022

So it's probably better to just use version and parse it correctly. Otherwise, it would be harder to support older versions.

tgodzik added a commit to scalameta/metals that referenced this pull request Aug 23, 2022
The change in question is in VirtusLab/scala-cli#1262

This change should future proof Metals
@Gedochao Gedochao added the enhancement New feature or request label Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add version of Scala to the output of scala-cli --version
5 participants