Skip to content

Commit e52f002

Browse files
committed
Fix the config sub-command doc
- it's not a `power` command, fixed it not to be tagged as such - moved the doc to the core commands level, as it is now useful to the average user - added a reference to the available config keys in the doc - extra examples, misc fixes
1 parent 2d7fca5 commit e52f002

File tree

6 files changed

+24
-17
lines changed

6 files changed

+24
-17
lines changed

modules/cli/src/main/scala/scala/cli/commands/config/ConfigOptions.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,14 @@ object ConfigOptions {
8888
implicit lazy val help: Help[ConfigOptions] = Help.derive
8989
private val helpHeader: String = s"Configure global settings for $fullRunnerName."
9090
private val cmdName = "config"
91-
private val websiteSuffix = s"misc/$cmdName"
9291
val helpMessage: String =
9392
s"""$helpHeader
9493
|
9594
|Available keys:
9695
| ${configKeyMessages(includeHidden = false).mkString(s"${System.lineSeparator} ")}
9796
|
9897
|${HelpMessages.commandFullHelpReference(cmdName)}
99-
|${HelpMessages.commandDocWebsiteReference(websiteSuffix)}""".stripMargin
98+
|${HelpMessages.commandDocWebsiteReference(cmdName)}""".stripMargin
10099
private def configKeyMessages(includeHidden: Boolean): Seq[String] = {
101100
val allKeys: Seq[Key[_]] = Keys.map.values.toSeq
102101
val keys: Seq[Key[_]] = if includeHidden then allKeys else allKeys.filterNot(_.hidden)
@@ -122,5 +121,5 @@ object ConfigOptions {
122121
|Available keys:
123122
| ${configKeyMessages(includeHidden = true).mkString(s"${System.lineSeparator} ")}
124123
|
125-
|${HelpMessages.commandDocWebsiteReference(websiteSuffix)}""".stripMargin
124+
|${HelpMessages.commandDocWebsiteReference(cmdName)}""".stripMargin
126125
}

website/docs/commands/misc/config.md renamed to website/docs/commands/config.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
---
2-
title: Config ⚡️
3-
sidebar_position: 1
2+
title: Config
3+
sidebar_position: 17
44
---
55

6-
:::caution
7-
The Config command is restricted and requires setting the `--power` option to be used.
8-
You can pass it explicitly or set it globally by running:
9-
10-
scala-cli config power true
11-
:::
12-
13-
import {ChainedSnippets} from "../../../src/components/MarkdownComponents.js";
6+
import {ChainedSnippets} from "../../src/components/MarkdownComponents.js";
147

158
The `config` sub-command makes it possible to get and set various configuration values, used by
169
other Scala CLI sub-commands.
1710

11+
The full list of the available configuration keys is available in [the reference docs](../reference/commands.md#config).
12+
1813
Examples of use:
1914
<ChainedSnippets>
2015

16+
```bash ignore
17+
scala-cli config power true
18+
scala-cli config power
19+
```
20+
21+
```text
22+
true
23+
```
24+
25+
</ChainedSnippets>
26+
27+
<ChainedSnippets>
28+
2129
```bash
2230
scala-cli config publish.user.name "Alex Me"
2331
scala-cli config publish.user.name

website/docs/commands/publishing/publish-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ In particular, one can configure:
3636
- Sonatype credentials (to upload artifacts to Maven Central)
3737
- a GitHub token (to upload repository secrets to GitHub, and artifacts to Maven repositories of GitHub Packages)
3838

39-
User-wide configuration in Scala CLI is handled by the [`config` command](/docs/commands/misc/config.md), and
39+
User-wide configuration in Scala CLI is handled by the [`config` command](/docs/commands/config.md), and
4040
the sections below show how to use it to configure things for `publish setup`.
4141

4242
### User details

website/docs/reference/commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Available keys:
6969
- suppress-warning.directives-in-multiple-files Globally suppresses warnings about directives declared in multiple source files.
7070
- suppress-warning.outdated-dependencies-files Globally suppresses warnings about outdated dependencies.
7171

72-
For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/misc/config
72+
For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/config
7373

7474
Accepts option groups: [config](./cli-options.md#config-options), [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [jvm](./cli-options.md#jvm-options), [logging](./cli-options.md#logging-options), [pgp scala signing](./cli-options.md#pgp-scala-signing-options), [verbosity](./cli-options.md#verbosity-options)
7575

website/docs/reference/scala-command/commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Available keys:
6868
- suppress-warning.directives-in-multiple-files Globally suppresses warnings about directives declared in multiple source files.
6969
- suppress-warning.outdated-dependencies-files Globally suppresses warnings about outdated dependencies.
7070

71-
For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/misc/config
71+
For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/config
7272

7373
Accepts option groups: [config](./cli-options.md#config-options), [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [jvm](./cli-options.md#jvm-options), [logging](./cli-options.md#logging-options), [pgp scala signing](./cli-options.md#pgp-scala-signing-options), [verbosity](./cli-options.md#verbosity-options)
7474

website/docs/reference/scala-command/runner-specification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ Available keys:
606606
- suppress-warning.directives-in-multiple-files Globally suppresses warnings about directives declared in multiple source files.
607607
- suppress-warning.outdated-dependencies-files Globally suppresses warnings about outdated dependencies.
608608

609-
For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/misc/config
609+
For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/config
610610

611611
### SHOULD have options
612612

0 commit comments

Comments
 (0)