From d7fc8f8075aca1e1c6995a5b5e7354025f1adab6 Mon Sep 17 00:00:00 2001 From: Maciej Gajek Date: Mon, 9 Oct 2023 11:10:07 +0200 Subject: [PATCH] Dont consume --power from ScalaCli.scala, instead add --power to GlobalOptions --- .../src/main/scala/scala/cli/ScalaCli.scala | 12 ++--- .../scala/cli/commands/ScalaCommand.scala | 1 + .../cli/commands/shared/GlobalOptions.scala | 10 +++- .../scala/cli/launcher/PowerOptions.scala | 7 +++ .../scala/cli/integration/ConfigTests.scala | 8 +-- website/docs/reference/cli-options.md | 12 +++++ website/docs/reference/commands.md | 44 +++++++-------- .../reference/scala-command/cli-options.md | 14 +++++ .../docs/reference/scala-command/commands.md | 18 +++---- .../scala-command/runner-specification.md | 54 +++++++++++++++++++ 10 files changed, 137 insertions(+), 43 deletions(-) diff --git a/modules/cli/src/main/scala/scala/cli/ScalaCli.scala b/modules/cli/src/main/scala/scala/cli/ScalaCli.scala index 7115fc19f8..dbba72fb4d 100644 --- a/modules/cli/src/main/scala/scala/cli/ScalaCli.scala +++ b/modules/cli/src/main/scala/scala/cli/ScalaCli.scala @@ -234,15 +234,13 @@ object ScalaCli { isSipScala = false args0.toArray else - // .ignoreUnrecognized drops '--' - val programArgs = args0.dropWhile(_ != "--") - val optionArgs = args0.takeWhile(_ != "--") - // Parse again to consume --power at any position - PowerOptions.parser.ignoreUnrecognized.parse(optionArgs) match { - case Right((powerOptions, unrecognizedArgs)) => + // Parse again to register --power at any position + // Don't consume it, GlobalOptions parsing will do it + PowerOptions.parser.ignoreUnrecognized.parse(args0) match { + case Right((powerOptions, _)) => if powerOptions.power then isSipScala = false - (unrecognizedArgs ++ programArgs).toArray + args0.toArray case Left(e) => System.err.println(e.message) sys.exit(1) diff --git a/modules/cli/src/main/scala/scala/cli/commands/ScalaCommand.scala b/modules/cli/src/main/scala/scala/cli/commands/ScalaCommand.scala index 50d421cf45..613df7dfe5 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/ScalaCommand.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/ScalaCommand.scala @@ -41,6 +41,7 @@ abstract class ScalaCommand[T <: HasGlobalOptions](implicit myParser: Parser[T], override def hasFullHelp = true override def hidden = shouldExcludeInSip protected var argvOpt = Option.empty[Array[String]] + private val shouldExcludeInSip = (isRestricted || isExperimental) && !ScalaCli.allowRestrictedFeatures override def setArgv(argv: Array[String]): Unit = { diff --git a/modules/cli/src/main/scala/scala/cli/commands/shared/GlobalOptions.scala b/modules/cli/src/main/scala/scala/cli/commands/shared/GlobalOptions.scala index 2c9fb22a05..e3635489f9 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/shared/GlobalOptions.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/shared/GlobalOptions.scala @@ -2,11 +2,19 @@ package scala.cli.commands.shared import caseapp.* +import scala.cli.launcher.PowerOptions + case class GlobalOptions( @Recurse logging: LoggingOptions = LoggingOptions(), @Recurse - globalSuppress: GlobalSuppressWarningOptions = GlobalSuppressWarningOptions() + globalSuppress: GlobalSuppressWarningOptions = GlobalSuppressWarningOptions(), + + /** Duplication of [[scala.cli.launcher.LauncherOptions.powerOptions]]. Thanks to this, our unit + * tests ensure that no subcommand defines an option that will clash with --power. + */ + @Recurse + powerOptions: PowerOptions = PowerOptions() ) object GlobalOptions { diff --git a/modules/cli/src/main/scala/scala/cli/launcher/PowerOptions.scala b/modules/cli/src/main/scala/scala/cli/launcher/PowerOptions.scala index a6d1deba82..abdc15ac9f 100644 --- a/modules/cli/src/main/scala/scala/cli/launcher/PowerOptions.scala +++ b/modules/cli/src/main/scala/scala/cli/launcher/PowerOptions.scala @@ -5,6 +5,13 @@ import caseapp.* import scala.cli.commands.shared.HelpGroup import scala.cli.commands.tags +/** Options extracted from [[LauncherOptions]] to allow for parsing them separately. Thanks to this + * and additional parsing we can read the --power flag placed anywhere in the command invocation. + * + * This option is duplicated in [[scala.cli.commands.shared.GlobalOptions]] so that we can ensure + * that no subcommand defines its own --power option Checking for clashing names is done in unit + * tests. + */ case class PowerOptions( @Group(HelpGroup.Launcher.toString) @HelpMessage("When called as 'scala', allow to use power commands too") diff --git a/modules/integration/src/test/scala/scala/cli/integration/ConfigTests.scala b/modules/integration/src/test/scala/scala/cli/integration/ConfigTests.scala index 309f439d6b..e9e39e28a9 100644 --- a/modules/integration/src/test/scala/scala/cli/integration/ConfigTests.scala +++ b/modules/integration/src/test/scala/scala/cli/integration/ConfigTests.scala @@ -23,23 +23,23 @@ class ConfigTests extends ScalaCliSuite { ) expect(before.out.trim().isEmpty) - os.proc(TestUtil.cli, "--power", "config", "publish.user.name", name).call( + os.proc(TestUtil.cli, "config", "publish.user.name", name, "--power").call( cwd = root, env = configEnv ) val res = - os.proc(TestUtil.cli, "--power", "config", "publish.user.name").call( + os.proc(TestUtil.cli, "config", "publish.user.name", "--power").call( cwd = root, env = configEnv ) expect(res.out.trim() == name) - os.proc(TestUtil.cli, "--power", "config", "publish.user.name", "--unset").call( + os.proc(TestUtil.cli, "config", "publish.user.name", "--unset", "--power").call( cwd = root, env = configEnv ) val after = - os.proc(TestUtil.cli, "--power", "config", "publish.user.name").call( + os.proc(TestUtil.cli, "config", "publish.user.name", "--power").call( cwd = root, env = configEnv ) diff --git a/website/docs/reference/cli-options.md b/website/docs/reference/cli-options.md index ff630f3bda..93b8a87563 100644 --- a/website/docs/reference/cli-options.md +++ b/website/docs/reference/cli-options.md @@ -932,6 +932,18 @@ Available in commands: Key server to push / pull keys from +## Power options + +Available in commands: + +[`add-path`](./commands.md#add-path), [`bloop`](./commands.md#bloop), [`bloop exit`](./commands.md#bloop-exit), [`bloop output`](./commands.md#bloop-output), [`bloop start`](./commands.md#bloop-start), [`clean`](./commands.md#clean), [`config`](./commands.md#config), [`default-file`](./commands.md#default-file), [`directories`](./commands.md#directories), [`help`](./commands.md#help), [`install completions` , `install-completions`](./commands.md#install-completions), [`install-home`](./commands.md#install-home), [`new`](./commands.md#new), [`pgp pull`](./commands.md#pgp-pull), [`pgp push`](./commands.md#pgp-push), [`publish setup`](./commands.md#publish-setup), [`github secret create` , `gh secret create`](./commands.md#github-secret-create), [`github secret list` , `gh secret list`](./commands.md#github-secret-list), [`uninstall`](./commands.md#uninstall), [`uninstall completions` , `uninstall-completions`](./commands.md#uninstall-completions), [`update`](./commands.md#update), [`version`](./commands.md#version) + + + +### `--power` + +When called as 'scala', allow to use power commands too + ## Publish options Available in commands: diff --git a/website/docs/reference/commands.md b/website/docs/reference/commands.md index 313b89cad9..428347b18d 100644 --- a/website/docs/reference/commands.md +++ b/website/docs/reference/commands.md @@ -14,7 +14,7 @@ Passed inputs will establish the Scala CLI project, for which the workspace will For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/clean -Accepts option groups: [bsp file](./cli-options.md#bsp-file-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options), [workspace](./cli-options.md#workspace-options) +Accepts option groups: [bsp file](./cli-options.md#bsp-file-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options), [workspace](./cli-options.md#workspace-options) ## compile @@ -73,7 +73,7 @@ Available keys: For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/config -Accepts option groups: [config](./cli-options.md#config-options), [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [global suppress warning](./cli-options.md#global-suppress-warning-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) +Accepts option groups: [config](./cli-options.md#config-options), [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [jvm](./cli-options.md#jvm-options), [logging](./cli-options.md#logging-options), [pgp scala signing](./cli-options.md#pgp-scala-signing-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ## dependency-update @@ -160,7 +160,7 @@ Accepts option groups: [compilation server](./cli-options.md#compilation-server- Print help message -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ## install completions @@ -170,7 +170,7 @@ Installs Scala CLI completions into your shell For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/completions -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [install completions](./cli-options.md#install-completions-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [install completions](./cli-options.md#install-completions-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ## new @@ -184,7 +184,7 @@ The `new` sub-command is experimental. Please bear in mind that non-ideal user experience should be expected. If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ## repl @@ -275,7 +275,7 @@ The `publish-setup` sub-command is experimental. Please bear in mind that non-ideal user experience should be expected. If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli -Accepts option groups: [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [input](./cli-options.md#input-options), [jvm](./cli-options.md#jvm-options), [logging](./cli-options.md#logging-options), [pgp push pull](./cli-options.md#pgp-push-pull-options), [pgp scala signing](./cli-options.md#pgp-scala-signing-options), [publish params](./cli-options.md#publish-params-options), [publish repository](./cli-options.md#publish-repository-options), [publish setup](./cli-options.md#publish-setup-options), [verbosity](./cli-options.md#verbosity-options), [version](./cli-options.md#version-options), [workspace](./cli-options.md#workspace-options) +Accepts option groups: [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [input](./cli-options.md#input-options), [jvm](./cli-options.md#jvm-options), [logging](./cli-options.md#logging-options), [pgp push pull](./cli-options.md#pgp-push-pull-options), [pgp scala signing](./cli-options.md#pgp-scala-signing-options), [power](./cli-options.md#power-options), [publish params](./cli-options.md#publish-params-options), [publish repository](./cli-options.md#publish-repository-options), [publish setup](./cli-options.md#publish-setup-options), [verbosity](./cli-options.md#verbosity-options), [version](./cli-options.md#version-options), [workspace](./cli-options.md#workspace-options) ## run @@ -316,7 +316,7 @@ The `secret-create` sub-command is experimental. Please bear in mind that non-ideal user experience should be expected. If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli -Accepts option groups: [coursier](./cli-options.md#coursier-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [secret](./cli-options.md#secret-options), [secret create](./cli-options.md#secret-create-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [coursier](./cli-options.md#coursier-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [secret](./cli-options.md#secret-options), [secret create](./cli-options.md#secret-create-options), [verbosity](./cli-options.md#verbosity-options) ## github secret list @@ -328,7 +328,7 @@ The `secret-list` sub-command is experimental. Please bear in mind that non-ideal user experience should be expected. If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [secret](./cli-options.md#secret-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [secret](./cli-options.md#secret-options), [verbosity](./cli-options.md#verbosity-options) ## setup-ide @@ -411,7 +411,7 @@ Uninstalls Scala CLI. Works only when installed with the installation script. For detailed installation instructions refer to our website: https://scala-cli.virtuslab.org/install -Accepts option groups: [compilation server](./cli-options.md#compilation-server-options), [coursier](./cli-options.md#coursier-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [uninstall](./cli-options.md#uninstall-options), [uninstall completions](./cli-options.md#uninstall-completions-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [compilation server](./cli-options.md#compilation-server-options), [coursier](./cli-options.md#coursier-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [uninstall](./cli-options.md#uninstall-options), [uninstall completions](./cli-options.md#uninstall-completions-options), [verbosity](./cli-options.md#verbosity-options) ## uninstall completions @@ -421,7 +421,7 @@ Uninstalls Scala CLI completions from your shell. For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/completions -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [uninstall completions](./cli-options.md#uninstall-completions-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [uninstall completions](./cli-options.md#uninstall-completions-options), [verbosity](./cli-options.md#verbosity-options) ## update @@ -431,7 +431,7 @@ If Scala CLI was installed with an external tool, refer to its update methods. For detailed installation instructions refer to our website: https://scala-cli.virtuslab.org/install -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [update](./cli-options.md#update-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [update](./cli-options.md#update-options), [verbosity](./cli-options.md#verbosity-options) ## version @@ -445,7 +445,7 @@ Scala version defined by the runner. For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/version -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options), [version](./cli-options.md#version-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options), [version](./cli-options.md#version-options) ## Hidden commands @@ -453,7 +453,7 @@ Accepts option groups: [global suppress warning](./cli-options.md#global-suppres Add entries to the PATH environment variable. -Accepts option groups: [add path](./cli-options.md#add-path-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [add path](./cli-options.md#add-path-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ### bloop @@ -465,7 +465,7 @@ If Bloop isn't currently running, it will be started. Bloop is the build server used by Scala CLI. For more information about Bloop, refer to https://scalacenter.github.io/bloop/ -Accepts option groups: [bloop](./cli-options.md#bloop-options), [compilation server](./cli-options.md#compilation-server-options), [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [jvm](./cli-options.md#jvm-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [bloop](./cli-options.md#bloop-options), [compilation server](./cli-options.md#compilation-server-options), [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [jvm](./cli-options.md#jvm-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ### bloop exit @@ -474,7 +474,7 @@ Stop Bloop if an instance is running. Bloop is the build server used by Scala CLI. For more information about Bloop, refer to https://scalacenter.github.io/bloop/ -Accepts option groups: [compilation server](./cli-options.md#compilation-server-options), [coursier](./cli-options.md#coursier-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [compilation server](./cli-options.md#compilation-server-options), [coursier](./cli-options.md#coursier-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ### bloop output @@ -483,7 +483,7 @@ Print Bloop output. Bloop is the build server used by Scala CLI. For more information about Bloop, refer to https://scalacenter.github.io/bloop/ -Accepts option groups: [compilation server](./cli-options.md#compilation-server-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [compilation server](./cli-options.md#compilation-server-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ### bloop start @@ -492,7 +492,7 @@ Starts a Bloop instance, if none is running. Bloop is the build server used by Scala CLI. For more information about Bloop, refer to https://scalacenter.github.io/bloop/ -Accepts option groups: [bloop start](./cli-options.md#bloop-start-options), [compilation server](./cli-options.md#compilation-server-options), [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [jvm](./cli-options.md#jvm-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [bloop start](./cli-options.md#bloop-start-options), [compilation server](./cli-options.md#compilation-server-options), [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [jvm](./cli-options.md#jvm-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ### bsp @@ -514,27 +514,27 @@ Generates default files for a Scala CLI project (i.e. .gitignore). For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/misc/default-file -Accepts option groups: [default file](./cli-options.md#default-file-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [default file](./cli-options.md#default-file-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ### directories Prints directories used by Scala CLI. -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ### install-home Install Scala CLI in a sub-directory of the home directory -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [install home](./cli-options.md#install-home-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [install home](./cli-options.md#install-home-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ### pgp pull -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [pgp pull](./cli-options.md#pgp-pull-options), [pgp push pull](./cli-options.md#pgp-push-pull-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [pgp pull](./cli-options.md#pgp-pull-options), [pgp push pull](./cli-options.md#pgp-push-pull-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ### pgp push -Accepts option groups: [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [jvm](./cli-options.md#jvm-options), [logging](./cli-options.md#logging-options), [pgp push](./cli-options.md#pgp-push-options), [pgp push pull](./cli-options.md#pgp-push-pull-options), [pgp scala signing](./cli-options.md#pgp-scala-signing-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [jvm](./cli-options.md#jvm-options), [logging](./cli-options.md#logging-options), [pgp push](./cli-options.md#pgp-push-options), [pgp push pull](./cli-options.md#pgp-push-pull-options), [pgp scala signing](./cli-options.md#pgp-scala-signing-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ### pgp create diff --git a/website/docs/reference/scala-command/cli-options.md b/website/docs/reference/scala-command/cli-options.md index 5ca2749d11..c3ecaaf76e 100644 --- a/website/docs/reference/scala-command/cli-options.md +++ b/website/docs/reference/scala-command/cli-options.md @@ -648,6 +648,20 @@ Aliases: `--list-main-class`, `--list-main-classes`, `--main-class-list` List main classes available in the current context +## Power options + +Available in commands: + +[`clean`](./commands.md#clean), [`config`](./commands.md#config), [`help`](./commands.md#help), [`install completions` , `install-completions`](./commands.md#install-completions), [`install-home`](./commands.md#install-home), [`uninstall`](./commands.md#uninstall), [`uninstall completions` , `uninstall-completions`](./commands.md#uninstall-completions), [`update`](./commands.md#update), [`version`](./commands.md#version) + + + +### `--power` + +`MUST have` per Scala Runner specification + +When called as 'scala', allow to use power commands too + ## Run options Available in commands: diff --git a/website/docs/reference/scala-command/commands.md b/website/docs/reference/scala-command/commands.md index 5da559c425..d4f3d29833 100644 --- a/website/docs/reference/scala-command/commands.md +++ b/website/docs/reference/scala-command/commands.md @@ -72,7 +72,7 @@ Available keys: For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/config -Accepts option groups: [config](./cli-options.md#config-options), [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [global suppress warning](./cli-options.md#global-suppress-warning-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) +Accepts option groups: [config](./cli-options.md#config-options), [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [jvm](./cli-options.md#jvm-options), [logging](./cli-options.md#logging-options), [pgp scala signing](./cli-options.md#pgp-scala-signing-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ### doc @@ -222,7 +222,7 @@ Scala version defined by the runner. For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/version -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options), [version](./cli-options.md#version-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options), [version](./cli-options.md#version-options) ## Implementation-specific commands @@ -250,13 +250,13 @@ Passed inputs will establish the Scala CLI project, for which the workspace will For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/clean -Accepts option groups: [bsp file](./cli-options.md#bsp-file-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options), [workspace](./cli-options.md#workspace-options) +Accepts option groups: [bsp file](./cli-options.md#bsp-file-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options), [workspace](./cli-options.md#workspace-options) ### help Print help message -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ### install completions @@ -266,13 +266,13 @@ Installs Scala CLI completions into your shell For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/completions -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [install completions](./cli-options.md#install-completions-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [install completions](./cli-options.md#install-completions-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ### install-home Install Scala CLI in a sub-directory of the home directory -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [install home](./cli-options.md#install-home-options), [logging](./cli-options.md#logging-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [install home](./cli-options.md#install-home-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [verbosity](./cli-options.md#verbosity-options) ### setup-ide @@ -300,7 +300,7 @@ Uninstalls Scala CLI. Works only when installed with the installation script. For detailed installation instructions refer to our website: https://scala-cli.virtuslab.org/install -Accepts option groups: [compilation server](./cli-options.md#compilation-server-options), [coursier](./cli-options.md#coursier-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [uninstall](./cli-options.md#uninstall-options), [uninstall completions](./cli-options.md#uninstall-completions-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [compilation server](./cli-options.md#compilation-server-options), [coursier](./cli-options.md#coursier-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [uninstall](./cli-options.md#uninstall-options), [uninstall completions](./cli-options.md#uninstall-completions-options), [verbosity](./cli-options.md#verbosity-options) ### uninstall completions @@ -310,7 +310,7 @@ Uninstalls Scala CLI completions from your shell. For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/completions -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [uninstall completions](./cli-options.md#uninstall-completions-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [uninstall completions](./cli-options.md#uninstall-completions-options), [verbosity](./cli-options.md#verbosity-options) ### update @@ -320,5 +320,5 @@ If Scala CLI was installed with an external tool, refer to its update methods. For detailed installation instructions refer to our website: https://scala-cli.virtuslab.org/install -Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [update](./cli-options.md#update-options), [verbosity](./cli-options.md#verbosity-options) +Accepts option groups: [global suppress warning](./cli-options.md#global-suppress-warning-options), [logging](./cli-options.md#logging-options), [power](./cli-options.md#power-options), [update](./cli-options.md#update-options), [verbosity](./cli-options.md#verbosity-options) diff --git a/website/docs/reference/scala-command/runner-specification.md b/website/docs/reference/scala-command/runner-specification.md index 5fa97fce45..fbb8fc8696 100644 --- a/website/docs/reference/scala-command/runner-specification.md +++ b/website/docs/reference/scala-command/runner-specification.md @@ -628,6 +628,12 @@ Available keys: For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/config +### MUST have options + +**--power** + +When called as 'scala', allow to use power commands too + ### SHOULD have options **--debug** @@ -4183,6 +4189,12 @@ Scala version defined by the runner. For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/version +### MUST have options + +**--power** + +When called as 'scala', allow to use power commands too +
### Implementantation specific options @@ -4795,6 +4807,12 @@ Passed inputs will establish the Scala CLI project, for which the workspace will For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/clean +### MUST have options + +**--power** + +When called as 'scala', allow to use power commands too +
### Implementantation specific options @@ -4874,6 +4892,12 @@ Directory where .scala-build is written Print help message +### MUST have options + +**--power** + +When called as 'scala', allow to use power commands too +
### Implementantation specific options @@ -4941,6 +4965,12 @@ Installs Scala CLI completions into your shell For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/completions +### MUST have options + +**--power** + +When called as 'scala', allow to use power commands too +
### Implementantation specific options @@ -5032,6 +5062,12 @@ Print completions to stdout Install Scala CLI in a sub-directory of the home directory +### MUST have options + +**--power** + +When called as 'scala', allow to use power commands too +
### Implementantation specific options @@ -5660,6 +5696,12 @@ Uninstalls Scala CLI. Works only when installed with the installation script. For detailed installation instructions refer to our website: https://scala-cli.virtuslab.org/install +### MUST have options + +**--power** + +When called as 'scala', allow to use power commands too +
### Implementantation specific options @@ -5829,6 +5871,12 @@ Uninstalls Scala CLI completions from your shell. For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/completions +### MUST have options + +**--power** + +When called as 'scala', allow to use power commands too +
### Implementantation specific options @@ -5908,6 +5956,12 @@ If Scala CLI was installed with an external tool, refer to its update methods. For detailed installation instructions refer to our website: https://scala-cli.virtuslab.org/install +### MUST have options + +**--power** + +When called as 'scala', allow to use power commands too +
### Implementantation specific options