diff --git a/src/chocolatey.tests/infrastructure.app/configuration/ConfigurationOptionsSpec.cs b/src/chocolatey.tests/infrastructure.app/configuration/ConfigurationOptionsSpec.cs index 99352ae65e..db1aa1e9ae 100644 --- a/src/chocolatey.tests/infrastructure.app/configuration/ConfigurationOptionsSpec.cs +++ b/src/chocolatey.tests/infrastructure.app/configuration/ConfigurationOptionsSpec.cs @@ -39,13 +39,15 @@ public abstract class ConfigurationOptionsSpecBase : TinySpec protected Mock console = new Mock(); protected static StringBuilder helpMessageContents = new StringBuilder(); - protected TextWriter writer = new StringWriter(helpMessageContents); + protected TextWriter errorWriter = new StringWriter(helpMessageContents); + protected TextWriter outputWriter = new StringWriter(helpMessageContents); public override void Context() { ConfigurationOptions.initialize_with(new Lazy(() => console.Object)); ConfigurationOptions.reset_options(); - console.Setup((c) => c.Error).Returns(writer); + console.Setup((c) => c.Error).Returns(errorWriter); + console.Setup((c) => c.Out).Returns(outputWriter); } protected Action because; diff --git a/src/chocolatey/infrastructure.app/configuration/ConfigurationOptions.cs b/src/chocolatey/infrastructure.app/configuration/ConfigurationOptions.cs index aa76a485dc..e55cd48073 100644 --- a/src/chocolatey/infrastructure.app/configuration/ConfigurationOptions.cs +++ b/src/chocolatey/infrastructure.app/configuration/ConfigurationOptions.cs @@ -134,7 +134,7 @@ private static void show_help(OptionSet optionSet, Action helpMessage) helpMessage.Invoke(); } - optionSet.WriteOptionDescriptions(Console.Error); + optionSet.WriteOptionDescriptions(Console.Out); } } } \ No newline at end of file diff --git a/src/chocolatey/infrastructure/adapters/Console.cs b/src/chocolatey/infrastructure/adapters/Console.cs index 9e6a0b4721..6a1ceeeafd 100644 --- a/src/chocolatey/infrastructure/adapters/Console.cs +++ b/src/chocolatey/infrastructure/adapters/Console.cs @@ -42,6 +42,8 @@ public System.ConsoleKeyInfo ReadKey(int timeoutMilliseconds) public TextWriter Error { get { return System.Console.Error; } } + public TextWriter Out { get { return System.Console.Out; } } + public void Write(object value) { System.Console.Write(value.to_string()); diff --git a/src/chocolatey/infrastructure/adapters/IConsole.cs b/src/chocolatey/infrastructure/adapters/IConsole.cs index 2e298645c6..a43d493c69 100644 --- a/src/chocolatey/infrastructure/adapters/IConsole.cs +++ b/src/chocolatey/infrastructure/adapters/IConsole.cs @@ -54,6 +54,15 @@ public interface IConsole /// 1 TextWriter Error { get; } + /// + /// Gets the standard output stream. + /// + /// + /// A that represents the standard output stream. + /// + /// 1 + TextWriter Out { get; } + /// /// Writes the specified string value to the standard output stream. ///