Skip to content

Commit

Permalink
Disambiguate --source command line option between CLI and compiler,…
Browse files Browse the repository at this point in the history
… favouring `scalac` meaning
  • Loading branch information
Gedochao committed Oct 31, 2024
1 parent 67a8043 commit 5d88ab1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ final case class PackageOptions(
@Group(HelpGroup.Package.toString)
@HelpMessage("Generate a source JAR rather than an executable JAR")
@Name("sources")
@Name("src")
@Tag(tags.restricted)
@Tag(tags.inShortHelp)
source: Boolean = false,
src: Boolean = false,
@Group(HelpGroup.Package.toString)
@HelpMessage("Generate a scaladoc JAR rather than an executable JAR")
@ExtraName("scaladoc")
Expand Down Expand Up @@ -144,7 +143,7 @@ final case class PackageOptions(
def packageTypeOpt: Option[PackageType] =
forcedPackageTypeOpt.orElse {
if (library) Some(PackageType.LibraryJar)
else if (source) Some(PackageType.SourceJar)
else if (src) Some(PackageType.SourceJar)
else if (assembly) Some(
PackageType.Assembly(
addPreamble = preamble,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite with TestScalaVersionArg
"--power",
"package",
jarSources,
"--source",
"--src",
"-o",
sourceJarPath,
extraOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ abstract class PackageTestDefinitions extends ScalaCliSuite with TestScalaVersio
test("source JAR") {
val dest = os.rel / "sources.jar"
simpleInputWithScalaAndSc.fromRoot { root =>
os.proc(TestUtil.cli, "--power", "package", extraOptions, ".", "-o", dest, "--source").call(
os.proc(TestUtil.cli, "--power", "package", extraOptions, ".", "-o", dest, "--src").call(
cwd = root,
stdin = os.Inherit,
stdout = os.Inherit
Expand Down
4 changes: 2 additions & 2 deletions website/docs/reference/cli-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -749,9 +749,9 @@ Overwrite the destination file, if it exists

Generate a library JAR rather than an executable JAR

### `--source`
### `--src`

Aliases: `--sources`, `--src`
Aliases: `--sources`

Generate a source JAR rather than an executable JAR

Expand Down

0 comments on commit 5d88ab1

Please sign in to comment.