未验证 提交 60d3d052 编写于 作者: A Adeel Mujahid 提交者: GitHub

Update System.CommandLine from 2.0.0-beta3 to beta4 (#71916)

上级 26da83df
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" /> <add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" /> <add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" /> <add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
<!-- TODO: Remove dotnet7 feeds when dependencies publish into dotnet8 feeds: https://github.com/dotnet/runtime/issues/63375. --> <!-- TODO: Remove dotnet7 feeds when dependencies publish into dotnet8 feeds: https://github.com/dotnet/runtime/issues/63375. -->
<add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" /> <add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
<add key="dotnet7-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7-transport/nuget/v3/index.json" /> <add key="dotnet7-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7-transport/nuget/v3/index.json" />
......
...@@ -48,9 +48,9 @@ ...@@ -48,9 +48,9 @@
<Uri>https://github.com/dotnet/llvm-project</Uri> <Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>33221526688e13aa1e41398fbed14fd7ad8fe147</Sha> <Sha>33221526688e13aa1e41398fbed14fd7ad8fe147</Sha>
</Dependency> </Dependency>
<Dependency Name="System.CommandLine" Version="2.0.0-beta3.22151.2"> <Dependency Name="System.CommandLine" Version="2.0.0-beta4.22355.1">
<Uri>https://github.com/dotnet/command-line-api</Uri> <Uri>https://github.com/dotnet/command-line-api</Uri>
<Sha>021ec68a4cb510c2cc125c6ebb78b9cfd4e3847a</Sha> <Sha>5618b2d243ccdeb5c7e50a298b33b13036b4351b</Sha>
</Dependency> </Dependency>
</ProductDependencies> </ProductDependencies>
<ToolsetDependencies> <ToolsetDependencies>
......
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
<optimizationPGOCoreCLRVersion>1.0.0-prerelease.22355.3</optimizationPGOCoreCLRVersion> <optimizationPGOCoreCLRVersion>1.0.0-prerelease.22355.3</optimizationPGOCoreCLRVersion>
<!-- Not auto-updated. --> <!-- Not auto-updated. -->
<MicrosoftDiaSymReaderNativeVersion>16.9.0-beta1.21055.5</MicrosoftDiaSymReaderNativeVersion> <MicrosoftDiaSymReaderNativeVersion>16.9.0-beta1.21055.5</MicrosoftDiaSymReaderNativeVersion>
<SystemCommandLineVersion>2.0.0-beta3.22114.1</SystemCommandLineVersion> <SystemCommandLineVersion>2.0.0-beta4.22355.1</SystemCommandLineVersion>
<TraceEventVersion>2.0.77</TraceEventVersion> <TraceEventVersion>2.0.77</TraceEventVersion>
<NETStandardLibraryRefVersion>2.1.0</NETStandardLibraryRefVersion> <NETStandardLibraryRefVersion>2.1.0</NETStandardLibraryRefVersion>
<NetStandardLibraryVersion>2.0.3</NetStandardLibraryVersion> <NetStandardLibraryVersion>2.0.3</NetStandardLibraryVersion>
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.CommandLine; using System.CommandLine;
using System.CommandLine.Builder;
using System.CommandLine.Invocation;
using System.CommandLine.Parsing; using System.CommandLine.Parsing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
...@@ -505,7 +503,7 @@ public ILVerifyRootCommand() ...@@ -505,7 +503,7 @@ public ILVerifyRootCommand()
AddOption(Verbose); AddOption(Verbose);
AddOption(Tokens); AddOption(Tokens);
this.SetHandler<InvocationContext>((InvocationContext context) => this.SetHandler(context =>
{ {
try try
{ {
......
// Licensed to the .NET Foundation under one or more agreements. // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license. // The .NET Foundation licenses this file to you under the MIT license.
using System.CommandLine; using System.CommandLine;
using System.IO; using System.IO;
var binOption = new Option<FileInfo?>( var binOption = new Option<FileInfo>(
name: "--bin", name: "--bin",
description: "Binary data to attach to the image"); description: "Binary data to attach to the image");
var imageOption = new Option<FileInfo?>( var imageOption = new Option<FileInfo>(
name: "--image", name: "--image",
description: "PE image to add the binary resource into"); description: "PE image to add the binary resource into");
var nameOption = new Option<string>( var nameOption = new Option<string>(
...@@ -17,14 +17,13 @@ ...@@ -17,14 +17,13 @@
rootCommand.AddOption(imageOption); rootCommand.AddOption(imageOption);
rootCommand.AddOption(nameOption); rootCommand.AddOption(nameOption);
rootCommand.SetHandler( rootCommand.SetHandler((FileInfo binaryData, FileInfo peImage, string name) =>
(FileInfo binaryData, FileInfo peImage, string name) => {
{ using ResourceUpdater updater = new(peImage);
using ResourceUpdater updater = new(peImage); updater.AddBinaryResource(name, File.ReadAllBytes(binaryData.FullName));
updater.AddBinaryResource(name, File.ReadAllBytes(binaryData.FullName)); },
},
binOption, binOption,
imageOption, imageOption,
nameOption); nameOption);
return rootCommand.Invoke(args); return rootCommand.Invoke(args);
\ No newline at end of file
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license. // The .NET Foundation licenses this file to you under the MIT license.
using System.CommandLine; using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.Parsing;
using System.IO; using System.IO;
namespace R2RDump namespace R2RDump
...@@ -117,7 +115,7 @@ public R2RDumpRootCommand() ...@@ -117,7 +115,7 @@ public R2RDumpRootCommand()
AddOption(SignatureBinary); AddOption(SignatureBinary);
AddOption(InlineSignatureBinary); AddOption(InlineSignatureBinary);
this.SetHandler<InvocationContext>((InvocationContext context) => this.SetHandler(context =>
context.ExitCode = new R2RDump(new DumpOptions(this, context.ParseResult)).Run()); context.ExitCode = new R2RDump(new DumpOptions(this, context.ParseResult)).Run());
} }
} }
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Immutable; using System.Collections.Immutable;
using System.CommandLine; using System.CommandLine;
using System.CommandLine.Builder;
using System.CommandLine.Invocation;
using System.CommandLine.Parsing; using System.CommandLine.Parsing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
using System; using System;
using System.CommandLine; using System.CommandLine;
using System.CommandLine.Builder;
using System.CommandLine.Invocation;
using System.CommandLine.Parsing; using System.CommandLine.Parsing;
using System.IO; using System.IO;
...@@ -19,7 +17,7 @@ void CreateCommand(string name, string description, Option[] options, Func<Build ...@@ -19,7 +17,7 @@ void CreateCommand(string name, string description, Option[] options, Func<Build
command.AddOption(option); command.AddOption(option);
foreach (var option in options) foreach (var option in options)
command.AddOption(option); command.AddOption(option);
command.SetHandler<InvocationContext>((InvocationContext context) => command.SetHandler(context =>
context.ExitCode = action(new BuildOptions(this, context.ParseResult))); context.ExitCode = action(new BuildOptions(this, context.ParseResult)));
AddCommand(command); AddCommand(command);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册