Skip to content

Update to the latest dotnet/command-line-api version #94746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@
<Uri>https://github.com/dotnet/llvm-project</Uri>
<Sha>e80993c0649d5e949eb4ac23fe22290b4ecb7e66</Sha>
</Dependency>
<Dependency Name="System.CommandLine" Version="2.0.0-beta4.23307.1">
<Dependency Name="System.CommandLine" Version="2.0.0-beta4.23407.1">
<Uri>https://github.com/dotnet/command-line-api</Uri>
<Sha>02fe27cd6a9b001c8feb7938e6ef4b3799745759</Sha>
<Sha>a045dd54a4c44723c215d992288160eb1401bb7f</Sha>
</Dependency>
<Dependency Name="Microsoft.SourceBuild.Intermediate.command-line-api" Version="0.1.430701">
<Dependency Name="Microsoft.SourceBuild.Intermediate.command-line-api" Version="0.1.440701">
<Uri>https://github.com/dotnet/command-line-api</Uri>
<Sha>02fe27cd6a9b001c8feb7938e6ef4b3799745759b</Sha>
<Sha>a045dd54a4c44723c215d992288160eb1401bb7f</Sha>
<SourceBuild RepoName="command-line-api" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.Cecil" Version="0.11.4-alpha.23509.2">
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
<optimizationPGOCoreCLRVersion>1.0.0-prerelease.23559.3</optimizationPGOCoreCLRVersion>
<!-- Not auto-updated. -->
<MicrosoftDiaSymReaderNativeVersion>16.11.29-beta1.23404.4</MicrosoftDiaSymReaderNativeVersion>
<SystemCommandLineVersion>2.0.0-beta4.23307.1</SystemCommandLineVersion>
<SystemCommandLineVersion>2.0.0-beta4.23407.1</SystemCommandLineVersion>
<TraceEventVersion>3.0.3</TraceEventVersion>
<NETStandardLibraryRefVersion>2.1.0</NETStandardLibraryRefVersion>
<NetStandardLibraryVersion>2.0.3</NetStandardLibraryVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/tools/Common/CommandLineHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static CliRootCommand UseVersion(this CliRootCommand command)
return command;
}

public static CliRootCommand UseExtendedHelp(this CliRootCommand command, Func<HelpContext, IEnumerable<Action<HelpContext>>> customizer)
public static CliRootCommand UseExtendedHelp(this CliRootCommand command, Func<HelpContext, IEnumerable<Func<HelpContext, bool>>> customizer)
{
foreach (CliOption option in command.Options)
{
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/tools/ILVerify/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,7 @@ public PEReader Resolve(string simpleName)
private static int Main(string[] args) =>
new CliConfiguration(new ILVerifyRootCommand().UseVersion())
{
ResponseFileTokenReplacer = Helpers.TryReadResponseFile,
EnableParseErrorReporting = true
ResponseFileTokenReplacer = Helpers.TryReadResponseFile
}.Invoke(args);
}
}
5 changes: 3 additions & 2 deletions src/coreclr/tools/aot/ILCompiler/ILCompilerRootCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ public ILCompilerRootCommand(string[] args) : base(".NET Native IL Compiler")
});
}

public static IEnumerable<Action<HelpContext>> GetExtendedHelp(HelpContext _)
public static IEnumerable<Func<HelpContext, bool>> GetExtendedHelp(HelpContext _)
{
foreach (Action<HelpContext> sectionDelegate in HelpBuilder.Default.GetLayout())
foreach (Func<HelpContext, bool> sectionDelegate in HelpBuilder.Default.GetLayout())
yield return sectionDelegate;

yield return _ =>
Expand Down Expand Up @@ -354,6 +354,7 @@ public static IEnumerable<Action<HelpContext>> GetExtendedHelp(HelpContext _)
Console.WriteLine();
Console.WriteLine("The following CPU names are predefined groups of instruction sets and can be used in --instruction-set too:");
Console.WriteLine(string.Join(", ", Internal.JitInterface.InstructionSetFlags.AllCpuNames));
return true;
};
}

Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/tools/aot/ILCompiler/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,7 @@ private static int Main(string[] args) =>
.UseVersion()
.UseExtendedHelp(ILCompilerRootCommand.GetExtendedHelp))
{
ResponseFileTokenReplacer = Helpers.TryReadResponseFile,
EnableParseErrorReporting = true
ResponseFileTokenReplacer = Helpers.TryReadResponseFile
}.Invoke(args);
}
}
5 changes: 3 additions & 2 deletions src/coreclr/tools/aot/crossgen2/Crossgen2RootCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,9 @@ public Crossgen2RootCommand(string[] args) : base(SR.Crossgen2BannerText)
});
}

public static IEnumerable<Action<HelpContext>> GetExtendedHelp(HelpContext _)
public static IEnumerable<Func<HelpContext, bool>> GetExtendedHelp(HelpContext _)
{
foreach (Action<HelpContext> sectionDelegate in HelpBuilder.Default.GetLayout())
foreach (Func<HelpContext, bool> sectionDelegate in HelpBuilder.Default.GetLayout())
yield return sectionDelegate;

yield return _ =>
Expand Down Expand Up @@ -343,6 +343,7 @@ public static IEnumerable<Action<HelpContext>> GetExtendedHelp(HelpContext _)
Console.WriteLine();
Console.WriteLine(SR.CpuFamilies);
Console.WriteLine(string.Join(", ", Internal.JitInterface.InstructionSetFlags.AllCpuNames));
return true;
};
}

Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/tools/aot/crossgen2/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -915,8 +915,7 @@ private static int Main(string[] args) =>
.UseVersion()
.UseExtendedHelp(Crossgen2RootCommand.GetExtendedHelp))
{
ResponseFileTokenReplacer = Helpers.TryReadResponseFile,
EnableParseErrorReporting = true
ResponseFileTokenReplacer = Helpers.TryReadResponseFile
}.Invoke(args);
}
}
5 changes: 3 additions & 2 deletions src/coreclr/tools/dotnet-pgo/PgoRootCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ int ExecuteWithContext(ParseResult result, bool setVerbosity)
}
}

public static IEnumerable<Action<HelpContext>> GetExtendedHelp(HelpContext context)
public static IEnumerable<Func<HelpContext, bool>> GetExtendedHelp(HelpContext context)
{
foreach (Action<HelpContext> sectionDelegate in HelpBuilder.Default.GetLayout())
foreach (Func<HelpContext, bool> sectionDelegate in HelpBuilder.Default.GetLayout())
yield return sectionDelegate;

if (context.Command.Name == "create-mibc" || context.Command.Name == "create-jittrace")
Expand All @@ -280,6 +280,7 @@ public static IEnumerable<Action<HelpContext>> GetExtendedHelp(HelpContext conte
""perfview collect -LogFile:logOfCollection.txt -DataFile:jittrace.etl -Zip:false -merge:false -providers:Microsoft-Windows-DotNETRuntime:0x1E000080018:4""
- Capture Jit and R2R events via perfview of all processes running using ETW tracing
");
return true;
};
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/tools/dotnet-pgo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ private static int Main(string[] args) =>
.UseVersion()
.UseExtendedHelp(PgoRootCommand.GetExtendedHelp))
{
ResponseFileTokenReplacer = Helpers.TryReadResponseFile,
EnableParseErrorReporting = true
ResponseFileTokenReplacer = Helpers.TryReadResponseFile
}.Invoke(args);

public static void PrintWarning(string warning)
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/tools/r2rdump/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,7 @@ public int Run()
public static int Main(string[] args) =>
new CliConfiguration(new R2RDumpRootCommand().UseVersion())
{
ResponseFileTokenReplacer = Helpers.TryReadResponseFile,
EnableParseErrorReporting = true
ResponseFileTokenReplacer = Helpers.TryReadResponseFile
}.Invoke(args);
}
}
5 changes: 1 addition & 4 deletions src/coreclr/tools/r2rtest/CommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,7 @@ void CreateCommand(string name, string description, CliOption[] options, Func<Bu
new CliOption<DirectoryInfo>("--asp-net-path", "-asp") { Description = "Path to SERP's ASP.NET Core folder" }.AcceptExistingOnly();

private static int Main(string[] args) =>
new CliConfiguration(new R2RTestRootCommand().UseVersion())
{
EnableParseErrorReporting = true
}.Invoke(args);
new CliConfiguration(new R2RTestRootCommand().UseVersion()).Invoke(args);
}

public partial class BuildOptions
Expand Down