-
Notifications
You must be signed in to change notification settings - Fork 131
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
Output of scala run --help
is unclear
#1669
Comments
Thanks for reporting! I think we shouldn't report the experimental/scala-cli only options in scala runner, seems like a bug.
Not sure I understand, wouldn't it be a internal thing that users shouldn't need to know about?
Good points! We'll try to clarify that! |
There is a part of it that is internal details and that part should not be exposed in the documentation. But as a user, I need to know what types of programs Scala CLI accepts. Do I need to write a “main method”? Can I use multiple files? Can configure the compiler (version and options) in the source code? Can I use third-party dependencies? If I use the Scala.js platform, do I have to set up Node.js myself? Are there any other requirements I should be aware of? Some of this information is available somewhere else (e.g. in the documentation of the |
Ok, thanks for explaining! |
@julienrf would a summary like this be sufficient?
▶ scala-prototype -help
Usage: /Users/pchabelski/IdeaProjects/scala-cli/out/cli/base-image/nativeImage.dest/scala <COMMAND>
Scala code runner is a command-line tool to interact with the Scala language. It lets you compile, run and test your Scala code.
The tool will use Java 17+ if found on PATH, otherwise the appropriate Java version will be downloaded automatically.
Arguments are generally treated as inputs in most sub-commands (with some exceptions, like the shebang sub-command).
Inputs can be .scala, .java and other files with supported extensions, as well as directories, URL addresses or other virtual sources.
Using directives can be used in all supported inputs.
External dependencies can be specified with the --dependency option or the using lib directive.
Default configurations are assumed for things like the Scala language version. (current default: 3.2.1)
Detailed documentation can be found on our website: https://scala-cli.virtuslab.org
Main commands:
clean Clean the workspace
compile Compile Scala code
doc Generate Scaladoc documentation
fmt, format, scalafmt Format Scala code
repl, console Fire-up a Scala REPL
run Compile and run Scala code. A main class has to be present.
test Compile and test Scala code
Miscellaneous commands:
about Print details about this application
version Print version
Other commands:
help Print help message
install completions, install-completions Installs completions into your shell
setup-ide Generate a BSP file that you can import into your IDE
shebang Like `run`, but more handy from shebang scripts
uninstall Uninstall scala-cli - only works when installed by the installation script
uninstall completions, uninstall-completions Uninstalls completions from your shell
update Update scala-cli - only works when installed by the installation script
Doctor commands:
doctor Print details about this application
See 'scala <command> --help' to read about a specific subcommand. To see full help run 'scala <command> --help-full'.
To run another Scala code runner version, specify it with '--cli-version' before any other argument, like 'scala --cli-version <version> args'.
When no subcommand is passed explicitly, an implicit subcommand is used based on context:
- if the '--version' option is passed, it prints the 'version' subcommand output, unmodified by any other options
- if any inputs were passed, it defaults to the 'run' subcommand
- additionally, when no inputs were passed, it defaults to the 'run' subcommand in the following scenarios:
- if a snippet was passed with any of the '--execute*' options
- if a main class was passed with the '--main-class' option alongside an extra '--classpath'
- otherwise, if no inputs were passed, it defaults to the 'repl' subcommand I think it's fair to explain to the user about some of the absolute basics for working with the tool, instead of sending him straight to the docs website... but then, we'd like to avoid walls of text after |
Thank you for working on this! I have a first question: the issue was about the output of Let me react on some specific parts of the first paragraph:
Does that apply to every subcommand?
I think this information is not really useful here because its applicability depends on which subcommand is used. I would consider instead adding it to the specific help of the relevant subcommands. |
Yeah, it shouldn't. I somehow got confused and assumed this ticket is about the default sub-command help, my bad 😅 So we should expand on individual subcommands usage explanations in their respective |
Is your feature request related to a problem? Please describe.
Running
scala run --help
(withscala
installed viacs install scala-experimental
) does not explain how the program is executed. Furthermore, it shows a lot of options that should probably stay in incubation in Scala CLI for some time.Describe the solution you'd like
I think a good start would be to explain better what it means to run the program (see also the discussion #1668 about the types of programs that we want to support), and which platforms (JVM, JS, native) are supported.
All the options should be documented more clearly. For instance, the description of the
--watch
option is too short. We should say that the program will be run again on every file change. But then the difference with--restart
is not clear. Isscala run --restart foo.scala
equivalent toscala run --watch foo.scala &
? How does file watching work when the program uses multiple files? Please clarify all these details in the documentation.I am not sure the following options should be part of the stable
scala
(unless you are very confident that they don’t require any maintenance effort, that the command-line interface is stable, and that they work extremely reliably?):--python
--markdown
--spark-standalone
--hadoop
--jmh
(could we use aMainAnnotation
instead, BTW?)--cross
The text was updated successfully, but these errors were encountered: