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

Fix PrintErrln and PrintErrf to behave like PrintErr #979

Closed
wants to merge 1 commit into from

Conversation

jhahn21
Copy link

@jhahn21 jhahn21 commented Oct 18, 2019

PrintErrln() and PrintErrf() prints to OutOrStderr while
PrintErr() prints to ErrOrStderr().

This PR fixes PrintErrln and PrintErrf to work like PrintErr.

PrintErrln() and PrintErrf() prints to OutOrStderr while
PrintErr() prints to ErrOrStderr().

This PR fixes PrintErrln and PrintErrf to work like PrintErr.
@CLAassistant
Copy link

CLAassistant commented Oct 18, 2019

CLA assistant check
All committers have signed the CLA.

@amdprophet
Copy link

I believe this is a dupe of #894.

@github-actions
Copy link

github-actions bot commented Apr 4, 2020

This PR is being marked as stale due to a long period of inactivity

@alessio
Copy link
Contributor

alessio commented Oct 1, 2020

I believe this is fixed in #894

@umarcor
Copy link
Contributor

umarcor commented Jun 29, 2021

@jpmcb, as commented by @alessio and @amdprophet, this was fixed in #894:

cobra/command.go

Lines 1225 to 1233 in 9a43267

// PrintErrln is a convenience method to Println to the defined Err output, fallback to Stderr if not set.
func (c *Command) PrintErrln(i ...interface{}) {
c.PrintErr(fmt.Sprintln(i...))
}
// PrintErrf is a convenience method to Printf to the defined Err output, fallback to Stderr if not set.
func (c *Command) PrintErrf(format string, i ...interface{}) {
c.PrintErr(fmt.Sprintf(format, i...))
}
.

This PR can be closed.

@jpmcb
Copy link
Collaborator

jpmcb commented Nov 1, 2021

Thanks @umarcor - always appreciate the help tidying up!

@jpmcb jpmcb closed this Nov 1, 2021
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.

6 participants