diff --git a/src/Cli/dotnet/CommonOptions.cs b/src/Cli/dotnet/CommonOptions.cs index c51a035147ed..26fdeceed775 100644 --- a/src/Cli/dotnet/CommonOptions.cs +++ b/src/Cli/dotnet/CommonOptions.cs @@ -111,7 +111,7 @@ public static Option OperatingSystemOption() => public static Option SelfContainedOption() => new ForwardedOption( - "--self-contained", + new string[] { "--sc", "--self-contained" }, CommonLocalizableStrings.SelfContainedOptionDescription) .ForwardAsMany(o => new string[] { $"-property:SelfContained={o}", "-property:_CommandLineDefinedSelfContained=true" }); diff --git a/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs b/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs index 579d1604b860..d1a934a45894 100644 --- a/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs +++ b/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs @@ -98,7 +98,9 @@ public void ItDoesNotImplicitlyRestoreAProjectWhenPublishingWithTheNoRestoreOpti [Theory] [InlineData(null)] + [InlineData("--sc")] [InlineData("--self-contained")] + [InlineData("--sc=true")] [InlineData("--self-contained=true")] public void ItPublishesSelfContainedWithRid(string args) { @@ -115,6 +117,7 @@ public void ItPublishesSelfContainedWithRid(string args) } [Theory] + [InlineData("--sc=false")] [InlineData("--self-contained=false")] [InlineData("--no-self-contained")] public void ItPublishesFrameworkDependentWithRid(string args) @@ -142,6 +145,7 @@ public void ItPublishesFrameworkDependentWithRid(string args) } [Theory] + [InlineData("--sc=false")] [InlineData("--self-contained=false")] [InlineData(null)] [InlineData("--no-self-contained")] @@ -165,7 +169,9 @@ public void ItPublishesFrameworkDependentWithoutRid(string args) } [Theory] + [InlineData("--sc --no-self-contained")] [InlineData("--self-contained --no-self-contained")] + [InlineData("--sc=true --no-self-contained")] [InlineData("--self-contained=true --no-self-contained")] public void ItFailsToPublishWithConflictingArgument(string args) {