Skip to content

Commit 5c41636

Browse files
authored
Merge branch 'release/3.0' into merge/release/3.0-preview9-to-release/3.0
2 parents 45eb84b + e443397 commit 5c41636

File tree

4 files changed

+600
-76
lines changed

4 files changed

+600
-76
lines changed

eng/Version.Details.xml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,69 +10,69 @@
1010
-->
1111
<Dependencies>
1212
<ProductDependencies>
13-
<Dependency Name="Microsoft.Win32.Registry" Version="4.6.0-preview9.19421.4" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
13+
<Dependency Name="Microsoft.Win32.Registry" Version="4.6.0-rc1.19420.10" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
1414
<Uri>https://github.com/dotnet/corefx</Uri>
15-
<Sha>8f95b1e7953e3fbff7f101d0ca6830fd9e37fd99</Sha>
15+
<Sha>d341fd37dcb2c22e382adccdc06770cf8f160577</Sha>
1616
</Dependency>
17-
<Dependency Name="System.ComponentModel.Annotations" Version="4.6.0-preview9.19421.4" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
17+
<Dependency Name="System.ComponentModel.Annotations" Version="4.6.0-rc1.19420.10" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
1818
<Uri>https://github.com/dotnet/corefx</Uri>
19-
<Sha>8f95b1e7953e3fbff7f101d0ca6830fd9e37fd99</Sha>
19+
<Sha>d341fd37dcb2c22e382adccdc06770cf8f160577</Sha>
2020
</Dependency>
21-
<Dependency Name="System.Diagnostics.DiagnosticSource" Version="4.6.0-preview9.19421.4" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
21+
<Dependency Name="System.Diagnostics.DiagnosticSource" Version="4.6.0-rc1.19420.10" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
2222
<Uri>https://github.com/dotnet/corefx</Uri>
23-
<Sha>8f95b1e7953e3fbff7f101d0ca6830fd9e37fd99</Sha>
23+
<Sha>d341fd37dcb2c22e382adccdc06770cf8f160577</Sha>
2424
</Dependency>
25-
<Dependency Name="System.Diagnostics.EventLog" Version="4.6.0-preview9.19421.4" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
25+
<Dependency Name="System.Diagnostics.EventLog" Version="4.6.0-rc1.19420.10" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
2626
<Uri>https://github.com/dotnet/corefx</Uri>
27-
<Sha>8f95b1e7953e3fbff7f101d0ca6830fd9e37fd99</Sha>
27+
<Sha>d341fd37dcb2c22e382adccdc06770cf8f160577</Sha>
2828
</Dependency>
29-
<Dependency Name="System.IO.Pipelines" Version="4.6.0-preview9.19421.4" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
29+
<Dependency Name="System.IO.Pipelines" Version="4.6.0-rc1.19420.10" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
3030
<Uri>https://github.com/dotnet/corefx</Uri>
31-
<Sha>8f95b1e7953e3fbff7f101d0ca6830fd9e37fd99</Sha>
31+
<Sha>d341fd37dcb2c22e382adccdc06770cf8f160577</Sha>
3232
</Dependency>
33-
<Dependency Name="System.Reflection.Metadata" Version="1.7.0-preview9.19421.4" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
33+
<Dependency Name="System.Reflection.Metadata" Version="1.7.0-rc1.19420.10" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
3434
<Uri>https://github.com/dotnet/corefx</Uri>
35-
<Sha>8f95b1e7953e3fbff7f101d0ca6830fd9e37fd99</Sha>
35+
<Sha>d341fd37dcb2c22e382adccdc06770cf8f160577</Sha>
3636
</Dependency>
37-
<Dependency Name="System.Runtime.CompilerServices.Unsafe" Version="4.6.0-preview9.19421.4" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
37+
<Dependency Name="System.Runtime.CompilerServices.Unsafe" Version="4.6.0-rc1.19420.10" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
3838
<Uri>https://github.com/dotnet/corefx</Uri>
39-
<Sha>8f95b1e7953e3fbff7f101d0ca6830fd9e37fd99</Sha>
39+
<Sha>d341fd37dcb2c22e382adccdc06770cf8f160577</Sha>
4040
</Dependency>
41-
<Dependency Name="System.Security.Cryptography.Cng" Version="4.6.0-preview9.19421.4" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
41+
<Dependency Name="System.Security.Cryptography.Cng" Version="4.6.0-rc1.19420.10" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
4242
<Uri>https://github.com/dotnet/corefx</Uri>
43-
<Sha>8f95b1e7953e3fbff7f101d0ca6830fd9e37fd99</Sha>
43+
<Sha>d341fd37dcb2c22e382adccdc06770cf8f160577</Sha>
4444
</Dependency>
45-
<Dependency Name="System.Security.Cryptography.Xml" Version="4.6.0-preview9.19421.4" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
45+
<Dependency Name="System.Security.Cryptography.Xml" Version="4.6.0-rc1.19420.10" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
4646
<Uri>https://github.com/dotnet/corefx</Uri>
47-
<Sha>8f95b1e7953e3fbff7f101d0ca6830fd9e37fd99</Sha>
47+
<Sha>d341fd37dcb2c22e382adccdc06770cf8f160577</Sha>
4848
</Dependency>
49-
<Dependency Name="System.ServiceProcess.ServiceController" Version="4.6.0-preview9.19421.4" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
49+
<Dependency Name="System.ServiceProcess.ServiceController" Version="4.6.0-rc1.19420.10" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
5050
<Uri>https://github.com/dotnet/corefx</Uri>
51-
<Sha>8f95b1e7953e3fbff7f101d0ca6830fd9e37fd99</Sha>
51+
<Sha>d341fd37dcb2c22e382adccdc06770cf8f160577</Sha>
5252
</Dependency>
53-
<Dependency Name="System.Text.Encodings.Web" Version="4.6.0-preview9.19421.4" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
53+
<Dependency Name="System.Text.Encodings.Web" Version="4.6.0-rc1.19420.10" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
5454
<Uri>https://github.com/dotnet/corefx</Uri>
55-
<Sha>8f95b1e7953e3fbff7f101d0ca6830fd9e37fd99</Sha>
55+
<Sha>d341fd37dcb2c22e382adccdc06770cf8f160577</Sha>
5656
</Dependency>
57-
<Dependency Name="System.Text.Json" Version="4.6.0-preview9.19421.4" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
57+
<Dependency Name="System.Text.Json" Version="4.6.0-rc1.19420.10" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
5858
<Uri>https://github.com/dotnet/corefx</Uri>
59-
<Sha>8f95b1e7953e3fbff7f101d0ca6830fd9e37fd99</Sha>
59+
<Sha>d341fd37dcb2c22e382adccdc06770cf8f160577</Sha>
6060
</Dependency>
61-
<Dependency Name="Microsoft.NETCore.App.Ref" Version="3.0.0-preview9-19421-20">
61+
<Dependency Name="Microsoft.NETCore.App.Ref" Version="3.0.0-rc1-19421-22">
6262
<Uri>https://github.com/dotnet/core-setup</Uri>
63-
<Sha>33c773a5c7602e599053fdbb3a12b7ecfda27e2e</Sha>
63+
<Sha>de78ba11198343228e7e4f8fbf2117add6c67944</Sha>
6464
</Dependency>
6565
<!--
6666
Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime.
6767
All Runtime.$rid packages should have the same version.
6868
-->
69-
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="3.0.0-preview9-19421-20">
69+
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="3.0.0-rc1-19421-22">
7070
<Uri>https://github.com/dotnet/core-setup</Uri>
71-
<Sha>33c773a5c7602e599053fdbb3a12b7ecfda27e2e</Sha>
71+
<Sha>de78ba11198343228e7e4f8fbf2117add6c67944</Sha>
7272
</Dependency>
73-
<Dependency Name="NETStandard.Library.Ref" Version="2.1.0-preview9-19421-20">
73+
<Dependency Name="NETStandard.Library.Ref" Version="2.1.0-rc1-19421-22">
7474
<Uri>https://github.com/dotnet/core-setup</Uri>
75-
<Sha>33c773a5c7602e599053fdbb3a12b7ecfda27e2e</Sha>
75+
<Sha>de78ba11198343228e7e4f8fbf2117add6c67944</Sha>
7676
</Dependency>
7777
</ProductDependencies>
7878
<ToolsetDependencies>
@@ -88,11 +88,11 @@
8888
<Uri>https://github.com/dotnet/arcade</Uri>
8989
<Sha>7aa107d818fe87e627154c0331d6de5d47f39a45</Sha>
9090
</Dependency>
91-
<Dependency Name="Microsoft.NETCore.Platforms" Version="3.0.0-preview9.19421.4" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
91+
<Dependency Name="Microsoft.NETCore.Platforms" Version="3.0.0-rc1.19420.10" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
9292
<Uri>https://github.com/dotnet/corefx</Uri>
93-
<Sha>8f95b1e7953e3fbff7f101d0ca6830fd9e37fd99</Sha>
93+
<Sha>d341fd37dcb2c22e382adccdc06770cf8f160577</Sha>
9494
</Dependency>
95-
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="3.3.1-beta3-19421-04">
95+
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="3.3.1-beta3-19422-01">
9696
<Uri>https://github.com/dotnet/roslyn</Uri>
9797
<Sha>807f6d9c1f62e66aa907513ccf0fa5b2372748f6</Sha>
9898
</Dependency>

eng/Versions.props

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<MinorVersion>0</MinorVersion>
1111
<PatchVersion>0</PatchVersion>
1212
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
13-
<PreReleaseVersionLabel>preview9</PreReleaseVersionLabel>
13+
<PreReleaseVersionLabel>rc1</PreReleaseVersionLabel>
1414
<AssemblyVersion Condition="'$(IsReferenceAssemblyProject)' != 'true'">$(VersionPrefix).0</AssemblyVersion>
1515
<!--
1616
We do not support changing reference assemblies in a patch. This ignores
@@ -42,28 +42,28 @@
4242
-->
4343
<PropertyGroup Label="Automated">
4444
<!-- Packages from dotnet/core-setup -->
45-
<MicrosoftNETCoreAppRefPackageVersion>3.0.0-preview9-19421-20</MicrosoftNETCoreAppRefPackageVersion>
46-
<MicrosoftNETCoreAppRuntimewinx64PackageVersion>3.0.0-preview9-19421-20</MicrosoftNETCoreAppRuntimewinx64PackageVersion>
47-
<NETStandardLibraryRefPackageVersion>2.1.0-preview9-19421-20</NETStandardLibraryRefPackageVersion>
45+
<MicrosoftNETCoreAppRefPackageVersion>3.0.0-rc1-19421-22</MicrosoftNETCoreAppRefPackageVersion>
46+
<MicrosoftNETCoreAppRuntimewinx64PackageVersion>3.0.0-rc1-19421-22</MicrosoftNETCoreAppRuntimewinx64PackageVersion>
47+
<NETStandardLibraryRefPackageVersion>2.1.0-rc1-19421-22</NETStandardLibraryRefPackageVersion>
4848
<!-- Packages from dotnet/corefx -->
49-
<MicrosoftWin32RegistryPackageVersion>4.6.0-preview9.19421.4</MicrosoftWin32RegistryPackageVersion>
50-
<SystemComponentModelAnnotationsPackageVersion>4.6.0-preview9.19421.4</SystemComponentModelAnnotationsPackageVersion>
51-
<SystemDiagnosticsDiagnosticSourcePackageVersion>4.6.0-preview9.19421.4</SystemDiagnosticsDiagnosticSourcePackageVersion>
52-
<SystemDiagnosticsEventLogPackageVersion>4.6.0-preview9.19421.4</SystemDiagnosticsEventLogPackageVersion>
53-
<SystemIOPipelinesPackageVersion>4.6.0-preview9.19421.4</SystemIOPipelinesPackageVersion>
54-
<SystemReflectionMetadataPackageVersion>1.7.0-preview9.19421.4</SystemReflectionMetadataPackageVersion>
55-
<SystemRuntimeCompilerServicesUnsafePackageVersion>4.6.0-preview9.19421.4</SystemRuntimeCompilerServicesUnsafePackageVersion>
56-
<SystemSecurityCryptographyCngPackageVersion>4.6.0-preview9.19421.4</SystemSecurityCryptographyCngPackageVersion>
57-
<SystemSecurityCryptographyXmlPackageVersion>4.6.0-preview9.19421.4</SystemSecurityCryptographyXmlPackageVersion>
58-
<SystemServiceProcessServiceControllerPackageVersion>4.6.0-preview9.19421.4</SystemServiceProcessServiceControllerPackageVersion>
59-
<SystemTextEncodingsWebPackageVersion>4.6.0-preview9.19421.4</SystemTextEncodingsWebPackageVersion>
60-
<SystemTextJsonPackageVersion>4.6.0-preview9.19421.4</SystemTextJsonPackageVersion>
49+
<MicrosoftWin32RegistryPackageVersion>4.6.0-rc1.19420.10</MicrosoftWin32RegistryPackageVersion>
50+
<SystemComponentModelAnnotationsPackageVersion>4.6.0-rc1.19420.10</SystemComponentModelAnnotationsPackageVersion>
51+
<SystemDiagnosticsDiagnosticSourcePackageVersion>4.6.0-rc1.19420.10</SystemDiagnosticsDiagnosticSourcePackageVersion>
52+
<SystemDiagnosticsEventLogPackageVersion>4.6.0-rc1.19420.10</SystemDiagnosticsEventLogPackageVersion>
53+
<SystemIOPipelinesPackageVersion>4.6.0-rc1.19420.10</SystemIOPipelinesPackageVersion>
54+
<SystemReflectionMetadataPackageVersion>1.7.0-rc1.19420.10</SystemReflectionMetadataPackageVersion>
55+
<SystemRuntimeCompilerServicesUnsafePackageVersion>4.6.0-rc1.19420.10</SystemRuntimeCompilerServicesUnsafePackageVersion>
56+
<SystemSecurityCryptographyCngPackageVersion>4.6.0-rc1.19420.10</SystemSecurityCryptographyCngPackageVersion>
57+
<SystemSecurityCryptographyXmlPackageVersion>4.6.0-rc1.19420.10</SystemSecurityCryptographyXmlPackageVersion>
58+
<SystemServiceProcessServiceControllerPackageVersion>4.6.0-rc1.19420.10</SystemServiceProcessServiceControllerPackageVersion>
59+
<SystemTextEncodingsWebPackageVersion>4.6.0-rc1.19420.10</SystemTextEncodingsWebPackageVersion>
60+
<SystemTextJsonPackageVersion>4.6.0-rc1.19420.10</SystemTextJsonPackageVersion>
6161
<!-- Workaround https://github.com/dotnet/cli/issues/10528-->
62-
<MicrosoftNETCorePlatformsPackageVersion>3.0.0-preview9.19421.4</MicrosoftNETCorePlatformsPackageVersion>
62+
<MicrosoftNETCorePlatformsPackageVersion>3.0.0-rc1.19420.10</MicrosoftNETCorePlatformsPackageVersion>
6363
<!-- Packages from dotnet/arcade -->
6464
<MicrosoftDotNetGenAPIPackageVersion>1.0.0-beta.19421.1</MicrosoftDotNetGenAPIPackageVersion>
6565
<!-- Packages from dotnet/roslyn -->
66-
<MicrosoftNetCompilersToolsetVersion>3.3.1-beta3-19421-04</MicrosoftNetCompilersToolsetVersion>
66+
<MicrosoftNetCompilersToolsetVersion>3.3.1-beta3-19422-01</MicrosoftNetCompilersToolsetVersion>
6767
</PropertyGroup>
6868
<PropertyGroup Label="Dependency version settings">
6969
<!--

src/Shared/src/CommandLineUtils/CommandLine/CommandLineApplication.cs

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,23 @@ namespace Microsoft.Extensions.CommandLineUtils
1313
{
1414
internal class CommandLineApplication
1515
{
16-
// Indicates whether the parser should throw an exception when it runs into an unexpected argument.
17-
// If this field is set to false, the parser will stop parsing when it sees an unexpected argument, and all
18-
// remaining arguments, including the first unexpected argument, will be stored in RemainingArguments property.
16+
// Indicates whether the parser should throw an exception when it runs into an unexpected argument. If this is
17+
// set to true (the default), the parser will throw on the first unexpected argument. Otherwise, all unexpected
18+
// arguments (including the first) are added to RemainingArguments.
1919
private readonly bool _throwOnUnexpectedArg;
2020

21-
public CommandLineApplication(bool throwOnUnexpectedArg = true)
21+
// Indicates whether the parser should check remaining arguments for command or option matches after
22+
// encountering an unexpected argument. Ignored if _throwOnUnexpectedArg is true (the default). If
23+
// _throwOnUnexpectedArg and this are both false, the first unexpected argument and all remaining arguments are
24+
// added to RemainingArguments. If _throwOnUnexpectedArg is false and this is true, only unexpected arguments
25+
// are added to RemainingArguments -- allowing a mix of expected and unexpected arguments, commands and
26+
// options.
27+
private readonly bool _continueAfterUnexpectedArg;
28+
29+
public CommandLineApplication(bool throwOnUnexpectedArg = true, bool continueAfterUnexpectedArg = false)
2230
{
2331
_throwOnUnexpectedArg = throwOnUnexpectedArg;
32+
_continueAfterUnexpectedArg = continueAfterUnexpectedArg;
2433
Options = new List<CommandOption>();
2534
Arguments = new List<CommandArgument>();
2635
Commands = new List<CommandLineApplication>();
@@ -145,6 +154,7 @@ public int Execute(params string[] args)
145154
{
146155
shortOption = arg.Substring(1).Split(new[] { ':', '=' }, 2);
147156
}
157+
148158
if (longOption != null)
149159
{
150160
processed = true;
@@ -153,13 +163,27 @@ public int Execute(params string[] args)
153163

154164
if (option == null)
155165
{
156-
if (string.IsNullOrEmpty(longOptionName) && !command._throwOnUnexpectedArg && AllowArgumentSeparator)
166+
var ignoreContinueAfterUnexpectedArg = false;
167+
if (string.IsNullOrEmpty(longOptionName) &&
168+
!command._throwOnUnexpectedArg &&
169+
AllowArgumentSeparator)
157170
{
158-
// skip over the '--' argument separator
171+
// Skip over the '--' argument separator then consume all remaining arguments. All
172+
// remaining arguments are unconditionally stored for further use.
159173
index++;
174+
ignoreContinueAfterUnexpectedArg = true;
175+
}
176+
177+
if (HandleUnexpectedArg(
178+
command,
179+
args,
180+
index,
181+
argTypeName: "option",
182+
ignoreContinueAfterUnexpectedArg))
183+
{
184+
continue;
160185
}
161186

162-
HandleUnexpectedArg(command, args, index, argTypeName: "option");
163187
break;
164188
}
165189

@@ -191,6 +215,7 @@ public int Execute(params string[] args)
191215
option = null;
192216
}
193217
}
218+
194219
if (shortOption != null)
195220
{
196221
processed = true;
@@ -204,7 +229,11 @@ public int Execute(params string[] args)
204229

205230
if (option == null)
206231
{
207-
HandleUnexpectedArg(command, args, index, argTypeName: "option");
232+
if (HandleUnexpectedArg(command, args, index, argTypeName: "option"))
233+
{
234+
continue;
235+
}
236+
208237
break;
209238
}
210239

@@ -268,6 +297,7 @@ public int Execute(params string[] args)
268297
processed = true;
269298
}
270299
}
300+
271301
if (!processed)
272302
{
273303
if (arguments == null)
@@ -280,9 +310,14 @@ public int Execute(params string[] args)
280310
arguments.Current.Values.Add(arg);
281311
}
282312
}
313+
283314
if (!processed)
284315
{
285-
HandleUnexpectedArg(command, args, index, argTypeName: "command or argument");
316+
if (HandleUnexpectedArg(command, args, index, argTypeName: "command or argument"))
317+
{
318+
continue;
319+
}
320+
286321
break;
287322
}
288323
}
@@ -490,17 +525,29 @@ public void ShowRootCommandFullNameAndVersion()
490525
Out.WriteLine();
491526
}
492527

493-
private void HandleUnexpectedArg(CommandLineApplication command, string[] args, int index, string argTypeName)
528+
private bool HandleUnexpectedArg(
529+
CommandLineApplication command,
530+
string[] args,
531+
int index,
532+
string argTypeName,
533+
bool ignoreContinueAfterUnexpectedArg = false)
494534
{
495535
if (command._throwOnUnexpectedArg)
496536
{
497537
command.ShowHint();
498538
throw new CommandParsingException(command, $"Unrecognized {argTypeName} '{args[index]}'");
499539
}
540+
else if (_continueAfterUnexpectedArg && !ignoreContinueAfterUnexpectedArg)
541+
{
542+
// Store argument for further use.
543+
command.RemainingArguments.Add(args[index]);
544+
return true;
545+
}
500546
else
501547
{
502-
// All remaining arguments are stored for further use
548+
// Store all remaining arguments for later use.
503549
command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
550+
return false;
504551
}
505552
}
506553

0 commit comments

Comments
 (0)