Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import $ivy.`com.lihaoyi::mill-contrib-bloop:$MILL_VERSION`
import $ivy.`io.get-coursier::coursier-launcher:2.0.16+73-gddc6d9cc9`
import $ivy.`io.github.alexarchambault.mill::mill-native-image-upload:0.1.8`
import $ivy.`io.github.alexarchambault.mill::mill-native-image-upload:0.1.9`
import $file.project.deps, deps.{Deps, Docker, Scala}
import $file.project.publish, publish.{ghOrg, ghName, ScalaCliPublishModule}
import $file.project.settings, settings.{CliLaunchers, FormatNativeImageConf, HasMacroAnnotations, HasTests, LocalRepo, PublishLocalNoFluff, localRepoResourcePath, platformExecutableJarExtension}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ object BloopRifleConfig {
bspStdout = None,
bspStderr = None,
period = 100.milliseconds,
timeout = 5.seconds,
initTimeout = 10.seconds
timeout = 10.seconds,
initTimeout = 30.seconds
)

}
2 changes: 1 addition & 1 deletion modules/build/src/main/scala/scala/build/Sources.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ object Sources {
// replace statements like
// import $ivy.`foo`,
// by
// import $ivy.$ ,
// import $ivy.A ,
// Ideally, we should just wipe those statements, and take care of keeping 'import' and ','
// for standard imports.
val buf = content.toCharArray
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,28 @@ object InstallCompletions extends ScalaCommand[InstallCompletionsOptions] {
sys.exit(1)
}

val rcFile = options.rcFile
.map(os.Path(_, os.pwd))
.getOrElse(defaultRcFile)
if (options.env) {
println(rcScript)
} else {

val banner = options.banner.replace("{NAME}", name)
val rcFile = options.rcFile
.map(os.Path(_, os.pwd))
.getOrElse(defaultRcFile)

val banner = options.banner.replace("{NAME}", name)

val updated = ProfileFileUpdater.addToProfileFile(rcFile.toNIO, banner, rcScript, Charset.defaultCharset())
val updated = ProfileFileUpdater.addToProfileFile(rcFile.toNIO, banner, rcScript, Charset.defaultCharset())

if (options.logging.verbosity >= 0) {
if (updated) {
System.err.println(s"Updated $rcFile")
System.err.println(
s"It is recommended to reload your shell, or source $rcFile in the " +
"current session, for its changes to be taken into account."
)
} else
System.err.println(s"$rcFile already up-to-date")
if (options.logging.verbosity >= 0) {
if (updated) {
System.err.println(s"Updated $rcFile")
System.err.println(
s"It is recommended to reload your shell, or source $rcFile in the " +
"current session, for its changes to be taken into account."
)
} else
System.err.println(s"$rcFile already up-to-date")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ final case class InstallCompletionsOptions(
rcFile: Option[String] = None,
directory: Option[String] = None,
banner: String = "{NAME} completions",
name: Option[String] = None
name: Option[String] = None,
env: Boolean = false
)
2 changes: 1 addition & 1 deletion project/settings.sc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import $ivy.`io.github.alexarchambault.mill::mill-native-image_mill0.9:0.1.8`
import $ivy.`io.github.alexarchambault.mill::mill-native-image_mill0.9:0.1.9`
import $file.deps, deps.{Deps, Docker}

import io.github.alexarchambault.millnativeimage.NativeImage
Expand Down
19 changes: 17 additions & 2 deletions website/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@ Once downloaded, right-click on `scala-cli-x86_64-apple-darwin.pkg` from Finder,

## Shell completions

### bash
Only bash and zsh completions are offered for now.

### zsh
Try the completions with
```text
$ eval "$(scala-cli install completions --env)"
$ scala-cli --<TAB>
```

Install them on your system with
```text
$ scala-cli install completions
```

If any of the `scala-cli install completions` command complained that your shell cannot be determined, specify it
with `--shell`, like
```text
$ scala-cli install completions --shell zsh
```
2 changes: 2 additions & 0 deletions website/docs/reference/cli-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ Aliases: `--shell`

#### `--name`

#### `--env`

## Java options

Available in commands:
Expand Down