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 more detail for sub-commands' help messages #1852

Merged
merged 27 commits into from Feb 15, 2023

Conversation

Gedochao
Copy link
Contributor

@Gedochao Gedochao commented Feb 13, 2023

Context: #1669

This is the first batch of help tweaks aiming at improving their usefulness.
It focuses on individual sub-commands' help messages (and not their options' help messages, which will be addressed separately).

Example for the run sub-command:

▶ scala-cli run --help
Usage: scala-cli run [options]
Compile and run Scala code.

Specific run configurations can be specified with both command line options and using directives defined in sources.
Command line options always take priority over using directives when a clash occurs, allowing to override configurations defined in sources.
Using directives can be defined in all supported input source file types.

For a run to be successful, a main method must be present on the classpath.
.sc scripts are an exception, as a main class is provided in their wrapper.

Multiple inputs can be passed at once.
Paths to directories, URLs and supported file types are accepted as inputs.
Accepted file extensions: .scala, .sc, .java, .jar, .md, .jar, .c, .h, .zip
For piped inputs use the corresponding alias: _.scala, _.java, _.sc, _.md
All supported types of inputs can be mixed with each other.

To pass arguments to the actual application, just add them after `--`, like:

```sh
/Users/pchabelski/IdeaProjects/scala-cli/out/cli/base-image/nativeImage.dest/scala-cli run Main.scala AnotherSource.scala -- first-arg second-arg
```

For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/run

Help options:
  --usage                                        Print usage and exit
  (...)

@Gedochao Gedochao force-pushed the new-subcommand-help-messages branch 2 times, most recently from 6fb9768 to 873802e Compare February 13, 2023 09:17
@Gedochao Gedochao marked this pull request as ready for review February 13, 2023 10:08
@Gedochao Gedochao added documentation Improvements or additions to documentation SIP-46 All the issues related to SIP-46 to turn Scala CLI into the official scala runner command. help All the issues related to improving help outputs labels Feb 13, 2023
@Gedochao Gedochao merged commit 008f62c into VirtusLab:main Feb 15, 2023
@Gedochao Gedochao deleted the new-subcommand-help-messages branch February 15, 2023 08:39
@Gedochao Gedochao mentioned this pull request Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help All the issues related to improving help outputs SIP-46 All the issues related to SIP-46 to turn Scala CLI into the official scala runner command.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants