Skip to content

Commit 78aa0b4

Browse files
committed
Move ConsoleHelpers to internal in subsystems
1 parent f1f6f24 commit 78aa0b4

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/System.CommandLine/ConsoleHelpers.cs renamed to src/System.CommandLine.Subsystems/ConsoleHelpers.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
namespace System.CommandLine
77
{
8-
// TODO: Added to project and made public for use in ErrorReportingSubsystem
9-
public static class ConsoleHelpers
8+
internal static class ConsoleHelpers
109
{
1110
private static readonly bool ColorsAreSupported = GetColorsAreSupported();
1211

@@ -21,15 +20,15 @@ private static bool GetColorsAreSupported()
2120
#endif
2221
&& !Console.IsOutputRedirected;
2322

24-
public static void SetTerminalForegroundRed()
23+
internal static void SetTerminalForegroundRed()
2524
{
2625
if (ColorsAreSupported)
2726
{
2827
Console.ForegroundColor = ConsoleColor.Red;
2928
}
3029
}
3130

32-
public static void ResetTerminalForegroundColor()
31+
internal static void ResetTerminalForegroundColor()
3332
{
3433
if (ColorsAreSupported)
3534
{

src/System.CommandLine.Subsystems/ErrorReportingSubsystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected internal override bool GetIsActivated(ParseResult? parseResult)
2626
protected internal override CliExit Execute(PipelineContext pipelineContext)
2727
{
2828
var _ = pipelineContext.ParseResult
29-
?? throw new ArgumentNullException($"{nameof(pipelineContext)}.ParseResult");
29+
?? throw new ArgumentException("The parse result has not been set", nameof(pipelineContext));
3030

3131
Report(pipelineContext.ConsoleHack, pipelineContext.ParseResult.Errors);
3232

src/System.CommandLine/System.CommandLine.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
<Compile Include="CliOption{T}.cs" />
4747
<Compile Include="CliRootCommand.cs" />
4848
<Compile Include="CliSymbol.cs" />
49-
<Compile Include="ConsoleHelpers.cs" />
5049
<Compile Include="LocalizationResources.cs" />
5150
<Compile Include="ParseResult.cs" />
5251
<Compile Include="Parsing\ArgumentResult.cs" />

0 commit comments

Comments
 (0)