Skip to content
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

(GH-468) Send Chocolatey Command Help to standard out not Err #549

Closed
wants to merge 1 commit into from

Conversation

secretGeek
Copy link
Contributor

Commands such as:
choco list -help | more
choco list -help | out-host -paging
...did not page as expected.
Similarly:
choco -help | out-file HelpDetails.txt
did not deliver all of the help output to the file.

(The workaround of using 2>&1 (or *>&1) is burdensome for the very
people who need help in the first place.)

So, in line with normal use of NDesk OptionSet, the option descriptions
are now written to Console.Out not Console.Error.

Closes #468

Commands such as:
    choco list -help | more
    choco list -help | out-host -paging
...did not page as expected.
Similarly:
    choco -help | out-file HelpDetails.txt
did not deliver all of the help output to the file.

(The workaround of using 2>&1 (or *>&1) is burdensome for the very
people who need help in the first place.)

So, in line with normal use of NDesk OptionSet, the option descriptions
are now written to Console.Out not Console.Error.

public override void Context()
{
ConfigurationOptions.initialize_with(new Lazy<IConsole>(() => 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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ferventcoder
Copy link
Member

Looks good, thanks!

@ferventcoder
Copy link
Member

Rebased and merged into stable at d9d59ff

@ferventcoder
Copy link
Member

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants