Skip to content

Commit 3c74d65

Browse files
authored
Align version option in System.CommandLine usages (#78886)
1 parent 62e87b4 commit 3c74d65

File tree

11 files changed

+16
-16
lines changed

11 files changed

+16
-16
lines changed

src/coreclr/tools/ILVerify/ILVerifyRootCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ internal sealed class ILVerifyRootCommand : RootCommand
3333
public Option<bool> Statistics { get; } =
3434
new(new[] { "--statistics" }, "Print verification statistics");
3535
public Option<bool> Verbose { get; } =
36-
new(new[] { "--verbose", "-v" }, "Verbose output");
36+
new(new[] { "--verbose" }, "Verbose output");
3737
public Option<bool> Tokens { get; } =
3838
new(new[] { "--tokens", "-t" }, "Include metadata tokens in error messages");
3939

src/coreclr/tools/ILVerify/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ public PEReader Resolve(string simpleName)
456456
private static int Main(string[] args) =>
457457
new CommandLineBuilder(new ILVerifyRootCommand())
458458
.UseTokenReplacer(Helpers.TryReadResponseFile)
459-
.UseVersionOption()
459+
.UseVersionOption("--version", "-v")
460460
.UseHelp()
461461
.UseParseErrorReporting()
462462
.Build()

src/coreclr/tools/aot/ILCompiler/ILCompilerRootCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ internal sealed class ILCompilerRootCommand : RootCommand
2424
public Option<bool> Optimize { get; } =
2525
new(new[] { "--optimize", "-O" }, "Enable optimizations");
2626
public Option<bool> OptimizeSpace { get; } =
27-
new(new[] { "--optimize-space", "-Os" }, "Enable optimizations, favor code space");
27+
new(new[] { "--optimize-space", "--Os" }, "Enable optimizations, favor code space");
2828
public Option<bool> OptimizeTime { get; } =
29-
new(new[] { "--optimize-time", "-Ot" }, "Enable optimizations, favor code speed");
29+
new(new[] { "--optimize-time", "--Ot" }, "Enable optimizations, favor code speed");
3030
public Option<string[]> MibcFilePaths { get; } =
3131
new(new[] { "--mibc", "-m" }, Array.Empty<string>, "Mibc file(s) for profile guided optimization");
3232
public Option<bool> EnableDebugInfo { get; } =

src/coreclr/tools/aot/ILCompiler/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ private static IEnumerable<int> ProcessWarningCodes(IEnumerable<string> warningC
657657
private static int Main(string[] args) =>
658658
new CommandLineBuilder(new ILCompilerRootCommand(args))
659659
.UseTokenReplacer(Helpers.TryReadResponseFile)
660-
.UseVersionOption("-v")
660+
.UseVersionOption("--version", "-v")
661661
.UseHelp(context => context.HelpBuilder.CustomizeLayout(ILCompilerRootCommand.GetExtendedHelp))
662662
.UseParseErrorReporting()
663663
.Build()

src/coreclr/tools/aot/crossgen2/Crossgen2RootCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ internal class Crossgen2RootCommand : RootCommand
3232
public Option<bool> Optimize { get; } =
3333
new(new[] { "--optimize", "-O" }, SR.EnableOptimizationsOption);
3434
public Option<bool> OptimizeDisabled { get; } =
35-
new(new[] { "--optimize-disabled", "-Od" }, SR.DisableOptimizationsOption);
35+
new(new[] { "--optimize-disabled", "--Od" }, SR.DisableOptimizationsOption);
3636
public Option<bool> OptimizeSpace { get; } =
37-
new(new[] { "--optimize-space", "-Os" }, SR.OptimizeSpaceOption);
37+
new(new[] { "--optimize-space", "--Os" }, SR.OptimizeSpaceOption);
3838
public Option<bool> OptimizeTime { get; } =
39-
new(new[] { "--optimize-time", "-Ot" }, SR.OptimizeSpeedOption);
39+
new(new[] { "--optimize-time", "--Ot" }, SR.OptimizeSpeedOption);
4040
public Option<bool> InputBubble { get; } =
4141
new(new[] { "--inputbubble" }, SR.InputBubbleOption);
4242
public Option<Dictionary<string, string>> InputBubbleReferenceFilePaths { get; } =

src/coreclr/tools/aot/crossgen2/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ internal static bool IsValidPublicKey(byte[] blob)
891891
private static int Main(string[] args) =>
892892
new CommandLineBuilder(new Crossgen2RootCommand(args))
893893
.UseTokenReplacer(Helpers.TryReadResponseFile)
894-
.UseVersionOption("-v")
894+
.UseVersionOption("--version", "-v")
895895
.UseHelp(context => context.HelpBuilder.CustomizeLayout(Crossgen2RootCommand.GetExtendedHelp))
896896
.UseParseErrorReporting()
897897
.Build()

src/coreclr/tools/dotnet-pgo/PgoRootCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ internal sealed class PgoRootCommand : RootCommand
8080
private Option<bool> _includeReadyToRun { get; } =
8181
new("--includeReadyToRun", "Include ReadyToRun methods in the trace file");
8282
private Option<Verbosity> _verbosity { get; } =
83-
new(new[] { "--verbose", "-v" }, () => Verbosity.normal, "Adjust verbosity level. Supported levels are minimal, normal, detailed, and diagnostic");
83+
new(new[] { "--verbose" }, () => Verbosity.normal, "Adjust verbosity level. Supported levels are minimal, normal, detailed, and diagnostic");
8484
private Option<bool> _isSorted { get; } =
8585
new("--sorted", "Generate sorted output.");
8686
private Option<bool> _showTimestamp { get; } =

src/coreclr/tools/dotnet-pgo/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public Program(PgoRootCommand command)
162162
private static int Main(string[] args) =>
163163
new CommandLineBuilder(new PgoRootCommand(args))
164164
.UseTokenReplacer(Helpers.TryReadResponseFile)
165-
.UseVersionOption("-v")
165+
.UseVersionOption("--version", "-v")
166166
.UseHelp(context => context.HelpBuilder.CustomizeLayout(PgoRootCommand.GetExtendedHelp))
167167
.UseParseErrorReporting()
168168
.Build()

src/coreclr/tools/r2rdump/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ public int Run()
499499
public static int Main(string[] args) =>
500500
new CommandLineBuilder(new R2RDumpRootCommand())
501501
.UseTokenReplacer(Helpers.TryReadResponseFile)
502+
.UseVersionOption("--version", "-v")
502503
.UseHelp()
503504
.UseParseErrorReporting()
504505
.Build()

src/coreclr/tools/r2rdump/R2RDumpRootCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ internal sealed class R2RDumpRootCommand : RootCommand
4949
public Option<bool> HideTransitions { get; } =
5050
new(new[] { "--hide-transitions", "--ht" }, "Don't include GC transitions in disassembly output");
5151
public Option<bool> Verbose { get; } =
52-
new(new[] { "--verbose", "-v" }, "Dump disassembly, unwindInfo, gcInfo and sectionContents");
52+
new(new[] { "--verbose" }, "Dump disassembly, unwindInfo, gcInfo and sectionContents");
5353
public Option<bool> Diff { get; } =
5454
new(new[] { "--diff" }, "Compare two R2R images");
5555
public Option<bool> DiffHideSameDisasm { get; } =

src/coreclr/tools/r2rtest/CommandLineOptions.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,14 +301,13 @@ void CreateCommand(string name, string description, Option[] options, Func<Build
301301
public Option<DirectoryInfo> AspNetPath { get; } =
302302
new Option<DirectoryInfo>(new[] { "--asp-net-path", "-asp" }, "Path to SERP's ASP.NET Core folder").AcceptExistingOnly();
303303

304-
static int Main(string[] args)
305-
{
306-
return new CommandLineBuilder(new R2RTestRootCommand())
304+
private static int Main(string[] args) =>
305+
new CommandLineBuilder(new R2RTestRootCommand())
306+
.UseVersionOption("--version", "-v")
307307
.UseHelp()
308308
.UseParseErrorReporting()
309309
.Build()
310310
.Invoke(args);
311-
}
312311
}
313312

314313
public partial class BuildOptions

0 commit comments

Comments
 (0)