Skip to content

Commit fba154a

Browse files
committed
Disambiguate --source command line option between CLI and compiler, favouring scalac meaning
1 parent 2be34c3 commit fba154a

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

modules/cli/src/main/scala/scala/cli/commands/package0/PackageOptions.scala

+2-3
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ final case class PackageOptions(
4949
@Group(HelpGroup.Package.toString)
5050
@HelpMessage("Generate a source JAR rather than an executable JAR")
5151
@Name("sources")
52-
@Name("src")
5352
@Tag(tags.restricted)
5453
@Tag(tags.inShortHelp)
55-
source: Boolean = false,
54+
src: Boolean = false,
5655
@Group(HelpGroup.Package.toString)
5756
@HelpMessage("Generate a scaladoc JAR rather than an executable JAR")
5857
@ExtraName("scaladoc")
@@ -144,7 +143,7 @@ final case class PackageOptions(
144143
def packageTypeOpt: Option[PackageType] =
145144
forcedPackageTypeOpt.orElse {
146145
if (library) Some(PackageType.LibraryJar)
147-
else if (source) Some(PackageType.SourceJar)
146+
else if (src) Some(PackageType.SourceJar)
148147
else if (assembly) Some(
149148
PackageType.Assembly(
150149
addPreamble = preamble,

modules/integration/src/test/scala/scala/cli/integration/BspTestDefinitions.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite with TestScalaVersionArg
17121712
"--power",
17131713
"package",
17141714
jarSources,
1715-
"--source",
1715+
"--src",
17161716
"-o",
17171717
sourceJarPath,
17181718
extraOptions

modules/integration/src/test/scala/scala/cli/integration/PackageTestDefinitions.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ abstract class PackageTestDefinitions extends ScalaCliSuite with TestScalaVersio
859859
test("source JAR") {
860860
val dest = os.rel / "sources.jar"
861861
simpleInputWithScalaAndSc.fromRoot { root =>
862-
os.proc(TestUtil.cli, "--power", "package", extraOptions, ".", "-o", dest, "--source").call(
862+
os.proc(TestUtil.cli, "--power", "package", extraOptions, ".", "-o", dest, "--src").call(
863863
cwd = root,
864864
stdin = os.Inherit,
865865
stdout = os.Inherit

website/docs/reference/cli-options.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -749,9 +749,9 @@ Overwrite the destination file, if it exists
749749

750750
Generate a library JAR rather than an executable JAR
751751

752-
### `--source`
752+
### `--src`
753753

754-
Aliases: `--sources`, `--src`
754+
Aliases: `--sources`
755755

756756
Generate a source JAR rather than an executable JAR
757757

0 commit comments

Comments
 (0)