10000 [Console] Default to stderr for the console helpers (2.7+) by alcohol · Pull Request #15795 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] Default to stderr for the console helpers (2.7+) #15795

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

Merged
merged 1 commit into from
Sep 22, 2015
Merged

[Console] Default to stderr for the console helpers (2.7+) #15795

merged 1 commit into from
Sep 22, 2015

Conversation

alcohol
Copy link
Contributor
@alcohol alcohol commented Sep 14, 2015

Interactive input/output and informational output such as progress should go to stderr if available.

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Only merge if #15794 is merged.

If someone explicitly wants to use stdout, they can simply pass $output->getStream() instead of $output in most use-cases.

@@ -89,6 +94,10 @@ public function run(OutputInterface $output, $cmd, $error = null, $callback = nu
*/
public function mustRun(OutputInterface $output, $cmd, $error = null, $callback = null)
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
Copy link
Contributor

Choose a reason for hiding this comment

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

this is useless as it is covered by run()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct. Let me adjust that quickly.

@Tobion
Copy link
Contributor
Tobion commented Sep 14, 2015

👍

Status: Reviewed

@fabpot
Copy link
Member
fabpot commented Sep 22, 2015

Thank you @alcohol.

@fabpot fabpot merged commit 90c2a96 into symfony:2.7 Sep 22, 2015
fabpot added a commit that referenced this pull request Sep 22, 2015
… (alcohol)

This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Default to stderr for the console helpers (2.7+)

Interactive input/output and informational output such as progress should go to `stderr` if available.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Only merge if #15794 is merged.

If someone explicitly wants to use `stdout`, they can simply pass `$output->getStream()` instead of `$output` in most use-cases.

Commits
-------

90c2a96 Default to stderr for console helpers (only merge if #15794 gets merged)
@alcohol
Copy link
Contributor Author
alcohol commented Sep 22, 2015

@fabpot not sure if this should be merged before/without #15794

@andig
Copy link
andig commented Jul 5, 2017

Interactive input/output and informational output such as progress should go to stderr if available.

Whats the reasoning for this? Broke a lot of bash scripts with progress bars...

@alcohol
Copy link
Contributor Author
alcohol commented Jul 5, 2017

@andig #13730 is a good starting point for some reading material into this decision.

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

Successfully merging this pull request may close these issues.

5 participants
0