Skip to content

Commit

Permalink
Downgrade System.CommandLine. Reverts dotnet#1436
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeRobich committed Jan 20, 2022
1 parent cf375d5 commit ebd6260
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>1fa6e45dd631b37e7b28a78907240aed8a300d50</Sha>
</Dependency>
<Dependency Name="System.CommandLine" Version="2.0.0-beta2.21615.1">
<Dependency Name="System.CommandLine" Version="2.0.0-beta1.21473.1">
<Uri>https://github.com/dotnet/command-line-api</Uri>
<Sha>c31ce2797305a4e084736c1d43a078d7e90f9b60</Sha>
<Sha>82273cb56c83b589e8e5b63da0ac9745ffc6e105</Sha>
</Dependency>
<Dependency Name="System.CommandLine.Rendering" Version="0.4.0-alpha.21615.1">
<Dependency Name="System.CommandLine.Rendering" Version="0.3.0-alpha.21473.1">
<Uri>https://github.com/dotnet/command-line-api</Uri>
<Sha>c31ce2797305a4e084736c1d43a078d7e90f9b60</Sha>
<Sha>82273cb56c83b589e8e5b63da0ac9745ffc6e105</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
Expand Down
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<!-- Dependencies from https://github.com/dotnet/roslyn -->
<MicrosoftNETCoreCompilersPackageVersion>4.0.1-1.21573.5</MicrosoftNETCoreCompilersPackageVersion>
<!-- Dependencies from https://github.com/dotnet/command-line-api -->
<SystemCommandLineVersion>2.0.0-beta2.21615.1</SystemCommandLineVersion>
<SystemCommandLineRenderingVersion>0.4.0-alpha.21615.1</SystemCommandLineRenderingVersion>
<SystemCommandLineVersion>2.0.0-beta1.21473.1</SystemCommandLineVersion>
<SystemCommandLineRenderingVersion>0.3.0-alpha.21473.1</SystemCommandLineRenderingVersion>
</PropertyGroup>
<!--
Other Dependency versions
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/FormatAnalyzersCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public async Task<int> InvokeAsync(InvocationContext context)
formatOptions = parseResult.ParseWorkspaceOptions(formatOptions);

if (parseResult.HasOption(SeverityOption) &&
parseResult.GetValueForOption(SeverityOption) is string { Length: > 0 } analyzerSeverity)
parseResult.ValueForOption(SeverityOption) is string { Length: > 0 } analyzerSeverity)
{
formatOptions = formatOptions with { AnalyzerSeverity = GetSeverity(analyzerSeverity) };
}

if (parseResult.HasOption(DiagnosticsOption) &&
parseResult.GetValueForOption(DiagnosticsOption) is string[] { Length: > 0 } diagnostics)
parseResult.ValueForOption(DiagnosticsOption) is string[] { Length: > 0 } diagnostics)
{
formatOptions = formatOptions with { Diagnostics = diagnostics.ToImmutableHashSet() };
}
Expand Down
10 changes: 5 additions & 5 deletions src/Commands/FormatCommandCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public static int GetExitCode(this WorkspaceFormatResult formatResult, bool chec
public static FormatOptions ParseVerbosityOption(this ParseResult parseResult, FormatOptions formatOptions)
{
if (parseResult.HasOption(VerbosityOption) &&
parseResult.GetValueForOption(VerbosityOption) is string { Length: > 0 } verbosity)
parseResult.ValueForOption(VerbosityOption) is string { Length: > 0 } verbosity)
{
formatOptions = formatOptions with { LogLevel = GetLogLevel(verbosity) };
}
Expand Down Expand Up @@ -169,8 +169,8 @@ public static FormatOptions ParseCommonOptions(this ParseResult parseResult, For

if (parseResult.HasOption(IncludeOption) || parseResult.HasOption(ExcludeOption))
{
var fileToInclude = parseResult.GetValueForOption(IncludeOption) ?? Array.Empty<string>();
var fileToExclude = parseResult.GetValueForOption(ExcludeOption) ?? Array.Empty<string>();
var fileToInclude = parseResult.ValueForOption(IncludeOption) ?? Array.Empty<string>();
var fileToExclude = parseResult.ValueForOption(ExcludeOption) ?? Array.Empty<string>();
HandleStandardInput(logger, ref fileToInclude, ref fileToExclude);
formatOptions = formatOptions with { FileMatcher = SourceFileMatcher.CreateMatcher(fileToInclude, fileToExclude) };
}
Expand All @@ -179,7 +179,7 @@ public static FormatOptions ParseCommonOptions(this ParseResult parseResult, For
{
formatOptions = formatOptions with { ReportPath = string.Empty };

if (parseResult.GetValueForOption(ReportOption) is string { Length: > 0 } reportPath)
if (parseResult.ValueForOption(ReportOption) is string { Length: > 0 } reportPath)
{
formatOptions = formatOptions with { ReportPath = reportPath };
}
Expand All @@ -189,7 +189,7 @@ public static FormatOptions ParseCommonOptions(this ParseResult parseResult, For
{
formatOptions = formatOptions with { BinaryLogPath = "format.binlog" };

if (parseResult.GetValueForOption(BinarylogOption) is string { Length: > 0 } binaryLogPath)
if (parseResult.ValueForOption(BinarylogOption) is string { Length: > 0 } binaryLogPath)
{
formatOptions = Path.GetExtension(binaryLogPath)?.Equals(".binlog") == false
? (formatOptions with { BinaryLogPath = Path.ChangeExtension(binaryLogPath, ".binlog") })
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/FormatStyleCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public async Task<int> InvokeAsync(InvocationContext context)
formatOptions = parseResult.ParseWorkspaceOptions(formatOptions);

if (parseResult.HasOption(SeverityOption) &&
parseResult.GetValueForOption(SeverityOption) is string { Length: > 0 } styleSeverity)
parseResult.ValueForOption(SeverityOption) is string { Length: > 0 } styleSeverity)
{
formatOptions = formatOptions with { CodeStyleSeverity = GetSeverity(styleSeverity) };
}

if (parseResult.HasOption(DiagnosticsOption) &&
parseResult.GetValueForOption(DiagnosticsOption) is string[] { Length: > 0 } diagnostics)
parseResult.ValueForOption(DiagnosticsOption) is string[] { Length: > 0 } diagnostics)
{
formatOptions = formatOptions with { Diagnostics = diagnostics.ToImmutableHashSet() };
}
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/RootFormatCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ public async Task<int> InvokeAsync(InvocationContext context)
formatOptions = parseResult.ParseWorkspaceOptions(formatOptions);

if (parseResult.HasOption(SeverityOption) &&
parseResult.GetValueForOption(SeverityOption) is string { Length: > 0 } defaultSeverity)
parseResult.ValueForOption(SeverityOption) is string { Length: > 0 } defaultSeverity)
{
formatOptions = formatOptions with { AnalyzerSeverity = GetSeverity(defaultSeverity) };
formatOptions = formatOptions with { CodeStyleSeverity = GetSeverity(defaultSeverity) };
}

if (parseResult.HasOption(DiagnosticsOption) &&
parseResult.GetValueForOption(DiagnosticsOption) is string[] { Length: > 0 } diagnostics)
parseResult.ValueForOption(DiagnosticsOption) is string[] { Length: > 0 } diagnostics)
{
formatOptions = formatOptions with { Diagnostics = diagnostics.ToImmutableHashSet() };
}
Expand Down

0 comments on commit ebd6260

Please sign in to comment.