Skip to content

Conversation

@Gedochao
Copy link
Contributor

@Gedochao Gedochao commented Sep 5, 2022

Fixes #1315

Before:

$ scala-cli run . [error] Found several main classes: ScalaMainClass2, ScalaMainClass1, scripts.ScalaScript_sc 

After these changes:

$ scala-cli run . [error] Found several main classes: ScalaMainClass1, ScalaMainClass2, scripts.ScalaScript_sc You can run one of them by passing it with the --main-class option, e.g. scala-cli . --main-class ScalaMainClass1 You can pick the main class interactively by passing the --interactive option. scala-cli . --interactive 
@Gedochao Gedochao added the enhancement New feature or request label Sep 5, 2022
@Gedochao Gedochao marked this pull request as draft September 5, 2022 18:01
@Gedochao Gedochao force-pushed the improve-error-messages branch 2 times, most recently from e942851 to f7d0024 Compare September 6, 2022 10:38
@Gedochao Gedochao force-pushed the improve-error-messages branch from f7d0024 to 08d355b Compare September 6, 2022 12:19
@Gedochao Gedochao force-pushed the improve-error-messages branch from 08d355b to 5fa98ff Compare September 6, 2022 12:45
@Gedochao Gedochao marked this pull request as ready for review September 6, 2022 13:45
Copy link
Contributor

@alexarchambault alexarchambault left a comment

Choose a reason for hiding this comment

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

Ok to merge, but just so you know, initially, for command suggestions such as these, my plan was to handle those like this one, that is catching specific exceptions in ScalaCli, and print suggestions for them.

That way, CLI-specific concerns don't leak in the build module. Originally, my intent was to maybe allow the build modules to be used as a library, where the CLI isn't around. So these suggestions don't make sense there. That said, I'm not sure the build modules are going to be used this way at some point, so it's no big deal...

@Gedochao Gedochao merged commit 5dc16d1 into VirtusLab:main Sep 6, 2022
@Gedochao Gedochao deleted the improve-error-messages branch September 6, 2022 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

2 participants