Skip to content

Commit

Permalink
Move changes to .scala files
Browse files Browse the repository at this point in the history
  • Loading branch information
romanowski committed Nov 3, 2021
1 parent 6eec84a commit 7f7a98e
Show file tree
Hide file tree
Showing 33 changed files with 110 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ import scala.build.preprocessing.ScopePath

case object UsingCustomJarDirectiveHandler extends UsingDirectiveHandler {
def name = "Custom JAR"
def description = "Manually adds JAR to the class path"
def usage = "using jar _path_ | using jars _path1_ _path2_ …"
def description = "Manually add JAR(s) to the class path"
def usage = "`using jar `_path_ | `using jars `_path1_ _path2_ …"
override def usageMd =
"`using jar `_path_ | `using jars `_path1_ _path2_ …"
"""using jar _path_
|
|using jars _path1_ _path2_ …""".stripMargin

override def examples = Seq(
"using jar \"/Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/chuusai/shapeless_2.13/2.3.7/shapeless_2.13-2.3.7.jar\""
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import scala.build.{Position, Positioned}

case object UsingDependencyDirectiveHandler extends UsingDirectiveHandler {
def name = "Dependency"
def description = "Adds dependencies"
def description = "Add dependencies"
def usage = "using lib org:name:ver | using libs org:name:ver org2:name2:ver2"
override def usageMd = "`using lib `_org_`:`name`:`ver"
override def examples = Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ import scala.build.options.{BuildOptions, JavaOptions}
import scala.build.preprocessing.ScopePath

case object UsingJavaHomeDirectiveHandler extends UsingDirectiveHandler {
def name = "Java home"
def description = "Sets Java home used to run your application or tests"
def usage = "using java-home|javaHome _path_"
override def usageMd = "`using java-home `_path_ | `using javaHome `_path_"
def name = "Java home"
def description = "Sets Java home used to run your application or tests"
def usage = "using java-home|javaHome _path_"
override def usageMd =
"""`using java-home `_path_
|
|`using javaHome `_path_""".stripMargin
override def examples = Seq(
"using java-home \"/Users/Me/jdks/11\""
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import scala.build.preprocessing.ScopePath

case object UsingJavaOptionsDirectiveHandler extends UsingDirectiveHandler {
def name = "Java options"
def description = "Adds Java options"
def description = "Add Java options"
def usage = "using java-opt _options_ | using javaOpt _options_"
override def usageMd =
"`using java-opt `_options_ | `using javaOpt `_options_"
"""`using java-opt `_options_
|
|`using javaOpt `_options_""".stripMargin
override def examples = Seq(
"using javaOpt -Xmx2g -Dsomething=a"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import scala.build.preprocessing.ScopePath

case object UsingRepositoryDirectiveHandler extends UsingDirectiveHandler {
def name = "Repository"
def description = "Adds a repository for dependency resolution"
def description = "Add a repository for dependency resolution"
def usage = "using repository _repository_"
override def usageMd = "`using repository `_repository_"
override def examples = Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ import scala.build.preprocessing.ScopePath

case object UsingResourcesDirectiveHandler extends UsingDirectiveHandler {
def name = "Resources"
def description = "Manually adds a resource directory to the class path"
def usage = "using resource _path_ | using resources _path1_ _path2_ …"
def description = "Manually add a resource directory to the class path"
def usage = """using resource _path_
|
|using resources _path1_ _path2_ …""".stripMargin
override def usageMd =
"`using resource `_path_ | `using resources `_path1_ _path2_ …"
"""`using resource `_path_
|
|`using resources `_path1_ _path2_ …""".stripMargin
override def examples = Seq(
"using resource \"./resources\""
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import scala.build.preprocessing.ScopePath

case object UsingScalaVersionDirectiveHandler extends UsingDirectiveHandler {
def name = "Scala version"
def description = "Sets the default Scala version"
def description = "Set the default Scala version"
def usage = "using scala _version_+"
override def usageMd = "`using scala `_version_+"
override def examples = Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import scala.build.preprocessing.ScopePath

case object UsingTestFrameworkDirectiveHandler extends UsingDirectiveHandler {
def name = "Test framework"
def description = "Sets test framework"
def description = "Set the test framework"
def usage = "using test-framework _class_name_"
override def usageMd =
"`using test-framework `_class_name_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package scala.cli.commands
import caseapp._

// format: off
@HelpMessage("Clean-up workspace")
@HelpMessage("Clean the workspace")
final case class CleanOptions(
@Recurse
logging: LoggingOptions = LoggingOptions(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final case class CompileOptions(

@Name("p")
@Name("classpath")
@HelpMessage("Print resulting class path")
@HelpMessage("Print the resulting class path")
classPath: Boolean = false
) {
// format: on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package scala.cli.commands
import caseapp._

// format: off
@HelpMessage("Prints directories used by scala-cli")
@HelpMessage("Prints directories used by `scala-cli`")
final case class DirectoriesOptions(
@Recurse
directories: SharedDirectoriesOptions = SharedDirectoriesOptions()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import caseapp._
import scala.build.options.BuildOptions

// format: off
@HelpMessage("Export current project to SBT or Mill")
@HelpMessage("Export current project to sbt or Mill")
final case class ExportOptions(
// FIXME There might be too many options for 'scala-cli export' there
@Recurse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final case class InstallCompletionsOptions(
@HelpMessage("Name of the shell, either zsh or bash")
format: Option[String] = None,

@HelpMessage("Path to *rc file, defaults to .bashrc or .zshrc depending on shell")
@HelpMessage("Path to `*rc` file, defaults to `.bashrc` or `.zshrc` depending on shell")
rcFile: Option[String] = None,

@HelpMessage("Completions output directory")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ package scala.cli.commands
import caseapp._

// format: off
@HelpMessage("Install scala-cli in a sub-directory of the home directory")
@HelpMessage("Install `scala-cli` in a sub-directory of the home directory")
final case class InstallHomeOptions(
@Group("InstallHome")
scalaCliBinaryPath: String,
@Group("InstallHome")
@Name("f")
@HelpMessage("Overwrite scala-cli if exists")
@HelpMessage("Overwrite `scala-cli`, if it exists")
force: Boolean = false,
@HelpMessage("Binary name")
binaryName: String = "scala-cli",
@HelpMessage("Print the env update")
@HelpMessage("Print the update to `env` variable")
env: Boolean = false,
@HelpMessage("Binary directory")
binDir: Option[String] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final case class MetabrowseOptions(
@Recurse
shared: SharedOptions = SharedOptions(),

@HelpMessage("Download and add rt.jar in the class path")
@HelpMessage("Download and add `rt.jar` in the class path")
addRtJar: Option[Boolean] = None,

@Group("Metabrowse server")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ final case class PackageOptions(
mainClass: MainClassOptions = MainClassOptions(),

@Group("Package")
@HelpMessage("Set destination path")
@HelpMessage("Set the destination path")
@Name("o")
output: Option[String] = None,
@Group("Package")
@HelpMessage("Overwrite destination file if it exists")
@HelpMessage("Overwrite the destination file, if it exists")
@Name("f")
force: Boolean = false,

Expand All @@ -38,22 +38,22 @@ final case class PackageOptions(
@Recurse
packager: PackagerOptions = PackagerOptions(),
@Group("Package")
@HelpMessage("Build debian package, available only on linux")
@HelpMessage("Build Debian package, available only on Linux")
deb: Boolean = false,
@Group("Package")
@HelpMessage("Build dmg package, available only on macOS")
dmg: Boolean = false,
@Group("Package")
@HelpMessage("Build rpm package, available only on linux")
@HelpMessage("Build rpm package, available only on Linux")
rpm: Boolean = false,
@Group("Package")
@HelpMessage("Build msi package, available only on windows")
@HelpMessage("Build msi package, available only on Windows")
msi: Boolean = false,
@Group("Package")
@HelpMessage("Build pkg package, available only on macOS")
pkg: Boolean = false,
@Group("Package")
@HelpMessage("Build docker image")
@HelpMessage("Build Docker image")
docker: Boolean = false,
) {
// format: on
Expand Down
38 changes: 19 additions & 19 deletions modules/cli/src/main/scala/scala/cli/commands/PackagerOptions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@ import caseapp.{Group, Help, HelpMessage, Name, Parser, ValueDescription}

// format: off
final case class PackagerOptions(
@HelpMessage("The version of generated package")
@HelpMessage("Set the version of the generated package")
version: String = "1.0.0",
@HelpMessage(
"Path to application logo in png format, it will be used to generate icon and banner/dialog in msi installer"
"Path to application logo in PNG format, it will be used to generate icon and banner/dialog in msi installer"
)
logoPath: Option[String] = None,
@HelpMessage("Set launcher app name which will be linked to PATH")
@HelpMessage("Set launcher app name, which will be linked to the PATH")
launcherApp: Option[String] = None,
@ValueDescription("Description")
description: Option[String] = None,
@HelpMessage("It should contains names and email addresses of co-maintainers of the package")
@HelpMessage("This should contain names and email addresses of co-maintainers of the package")
@Name("m")
maintainer: Option[String] = None,
@Group("Debian")
@HelpMessage(
"The list of debian package that this package is absolute incompatibility"
"The list of Debian package that this package is not compatible with"
)
@ValueDescription("debian dependencies conflicts")
@ValueDescription("Debian dependencies conflicts")
debianConflicts: List[String] = Nil,
@Group("Debian")
@HelpMessage("The list of debian package that this package depends on")
@ValueDescription("debian dependencies")
@HelpMessage("The list of Debian packages that this package depends on")
@ValueDescription("Debian dependencies")
debianDependencies: List[String] = Nil,
@Group("Debian")
@HelpMessage(
"Architecture that are supported by the repository, default: all"
"Architectures that are supported by the repository (default: all)"
)
debArchitecture: String = "all",
@Group("MacOS")
Expand All @@ -39,34 +39,34 @@ final case class PackagerOptions(
identifier: Option[String] = None,
@Group("RedHat")
@HelpMessage(
"License that are supported by the repository - list of licenses https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing"
"Licenses that are supported by the repository (list of licenses: https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing)"
)
license: Option[String] = None,
@Group("RedHat")
@HelpMessage(
"The number of times this version of the software was released, default: 1"
"The number of times this version of the software was released (default: 1)"
)
release: String = "1",
@HelpMessage("Architecture that are supported by the repository, default: noarch")
@HelpMessage("Architectures that are supported by the repository (default: noarch)")
rpmArchitecture: String = "noarch",
@Group("Windows")
@HelpMessage("Path to license file")
@HelpMessage("Path to the license file")
licensePath: Option[String] = None,
@Group("Windows")
@HelpMessage("Name of product, default: Scala packager")
@HelpMessage("Name of product (default: Scala packager)")
productName: String = "Scala packager",
@Group("Windows")
@HelpMessage("Text will be displayed on exit dialog")
@HelpMessage("Text that will be displayed on the exit dialog")
exitDialog: Option[String] = None,
@Group("Windows")
@HelpMessage("Suppress Wix ICE validation (required for users that are neither interactive, not local administrators)")
suppressValidation: Option[Boolean] = None,
@Group("Windows")
@HelpMessage("Path to extra WIX config content")
@HelpMessage("Path to extra WIX configuration content")
@ValueDescription("path")
extraConfig: List[String] = Nil,
@Group("Windows")
@HelpMessage("Whether a 64-bit executable is getting packaged")
@HelpMessage("Whether a 64-bit executable is being packaged")
@Name("64")
is64Bits: Boolean = true,
@Group("Windows")
Expand All @@ -79,7 +79,7 @@ final case class PackagerOptions(
dockerFrom: Option[String] = None,
@Group("Docker")
@HelpMessage(
"The image registry, if will be empty it will be used default registry"
"The image registry; if empty, it will use the default registry"
)
dockerImageRegistry: Option[String] = None,
@Group("Docker")
Expand All @@ -89,7 +89,7 @@ final case class PackagerOptions(
dockerImageRepository: Option[String] = None,
@Group("Docker")
@HelpMessage(
"The image tag, the default tag is latest"
"The image tag; the default tag is `latest`"
)
dockerImageTag: Option[String] = None,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ final case class ReplOptions(
compileCross: CompileCrossOptions = CompileCrossOptions(),

@Group("Repl")
@HelpMessage("Use Ammonite rather than the default Scala REPL")
@HelpMessage("Use Ammonite (instead of the default Scala REPL)")
@Name("A")
@Name("amm")
ammonite: Option[Boolean] = None,

@Group("Repl")
@HelpMessage("Set Ammonite version")
@HelpMessage("Set the Ammonite version")
@Name("ammoniteVer")
ammoniteVersion: Option[String] = None,

Expand All @@ -34,7 +34,7 @@ final case class ReplOptions(

@Group("Repl")
@Hidden
@HelpMessage("Don't actually run the REPL, only fetch it")
@HelpMessage("Don't actually run the REPL, just fetch it")
replDryRun: Boolean = false
) {
// format: on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import scala.build.options.BuildOptions
// format: off
@HelpMessage("""|Compile and run Scala code.
|
|To pass arguments to the application, just add them after '--', like:
|scala-cli MyApp.scala -- first-arg second-arg""".stripMargin)
|To pass arguments to the application, just add them after `--`, like:
|
|```sh
|scala-cli MyApp.scala -- first-arg second-arg
|```""".stripMargin)
final case class RunOptions(
@Recurse
shared: SharedOptions = SharedOptions(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ final case class ScalaJsOptions(
js: Boolean = false,

@Group("Scala.JS")
@HelpMessage("Scala JS version")
@HelpMessage("The Scala JS version")
jsVersion: Option[String] = None,
@Group("Scala.JS")
@HelpMessage("Scala JS mode, either \"dev\" or \"release\"")
@HelpMessage("The Scala JS mode, either `dev` or `release`")
jsMode: Option[String] = None,
@HelpMessage("Scala JS module kind: commonjs/common, esmodule/es, nomodule/none")
@HelpMessage("The Scala JS module kind: commonjs/common, esmodule/es, nomodule/none")
@Group("Scala.JS")
jsModuleKind: Option[String] = None,

Expand Down
Loading

0 comments on commit 7f7a98e

Please sign in to comment.