<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-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. -->
<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" />
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>33221526688e13aa1e41398fbed14fd7ad8fe147</Sha>
</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>
- <Sha>021ec68a4cb510c2cc125c6ebb78b9cfd4e3847a</Sha>
+ <Sha>5618b2d243ccdeb5c7e50a298b33b13036b4351b</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<optimizationPGOCoreCLRVersion>1.0.0-prerelease.22355.3</optimizationPGOCoreCLRVersion>
<!-- Not auto-updated. -->
<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>
<NETStandardLibraryRefVersion>2.1.0</NETStandardLibraryRefVersion>
<NetStandardLibraryVersion>2.0.3</NetStandardLibraryVersion>
using System;
using System.Collections.Generic;
using System.CommandLine;
-using System.CommandLine.Builder;
-using System.CommandLine.Invocation;
using System.CommandLine.Parsing;
using System.IO;
using System.Linq;
AddOption(Verbose);
AddOption(Tokens);
- this.SetHandler<InvocationContext>((InvocationContext context) =>
+ this.SetHandler(context =>
{
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.
using System.CommandLine;
using System.IO;
-var binOption = new Option<FileInfo?>(
+var binOption = new Option<FileInfo>(
name: "--bin",
description: "Binary data to attach to the image");
-var imageOption = new Option<FileInfo?>(
+var imageOption = new Option<FileInfo>(
name: "--image",
description: "PE image to add the binary resource into");
var nameOption = new Option<string>(
rootCommand.AddOption(imageOption);
rootCommand.AddOption(nameOption);
-rootCommand.SetHandler(
- (FileInfo binaryData, FileInfo peImage, string name) =>
- {
- using ResourceUpdater updater = new(peImage);
- updater.AddBinaryResource(name, File.ReadAllBytes(binaryData.FullName));
- },
+rootCommand.SetHandler((FileInfo binaryData, FileInfo peImage, string name) =>
+ {
+ using ResourceUpdater updater = new(peImage);
+ updater.AddBinaryResource(name, File.ReadAllBytes(binaryData.FullName));
+ },
binOption,
imageOption,
nameOption);
-return rootCommand.Invoke(args);
\ No newline at end of file
+return rootCommand.Invoke(args);
// The .NET Foundation licenses this file to you under the MIT license.
using System.CommandLine;
-using System.CommandLine.Invocation;
-using System.CommandLine.Parsing;
using System.IO;
namespace R2RDump
AddOption(SignatureBinary);
AddOption(InlineSignatureBinary);
- this.SetHandler<InvocationContext>((InvocationContext context) =>
+ this.SetHandler(context =>
context.ExitCode = new R2RDump(new DumpOptions(this, context.ParseResult)).Run());
}
}
using System.Collections.Generic;
using System.Collections.Immutable;
using System.CommandLine;
-using System.CommandLine.Builder;
-using System.CommandLine.Invocation;
using System.CommandLine.Parsing;
using System.IO;
using System.Linq;
using System;
using System.CommandLine;
-using System.CommandLine.Builder;
-using System.CommandLine.Invocation;
using System.CommandLine.Parsing;
using System.IO;
command.AddOption(option);
foreach (var option in options)
command.AddOption(option);
- command.SetHandler<InvocationContext>((InvocationContext context) =>
+ command.SetHandler(context =>
context.ExitCode = action(new BuildOptions(this, context.ParseResult)));
AddCommand(command);
}