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

[feature] conan graph info should print to stdout #15162

Closed
1 task done
kyllingstad opened this issue Nov 23, 2023 · 2 comments · Fixed by #15170
Closed
1 task done

[feature] conan graph info should print to stdout #15162

kyllingstad opened this issue Nov 23, 2023 · 2 comments · Fixed by #15170
Assignees
Labels
Milestone

Comments

@kyllingstad
Copy link

What is your suggestion?

conan graph info should print its primary output – the YAML code containing the dependency graph info – to the standard output stream.

Currently, it is printed to the standard error stream, which is problematic because:

  • It is not immediately obvious why piping the output to a file or program doesn't work. (Experienced users will soon find that adding 2>&1 to the command line helps, but to many, this is rather arcane knowledge.)
  • The YAML code gets mixed up with the status messages printed at the start, so even if you do pipe stderr to a file, the result is not a valid YAML file.

I am aware that using e.g. --format=json does result in clean output being printed to stdout as desired, but this is not obvious from the documentation, and YAML does not seem to be among the supported formats for that switch. Ideally, I'd like to see something like --format=yaml being an implicit default.

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@AbrilRBS
Copy link
Member

AbrilRBS commented Nov 23, 2023

Hi @kyllingstad thanks a lot for your report. You're right in that the --format=text formatter for graph info should be printing to stdout - I've proposed #15170 to fix the issue.

the YAML code containing the dependency graph info – to the standard output stream.

Please note that the graph info output is not YAML. The format just looks a bit like that, but it's not our intention to make it actually output YAML, and it's only meant as a visual representation. If you ever need structured output, please use the --format=json one, which we feel is enough to support any conceivable user-case :)

@kyllingstad
Copy link
Author

I understand. Thanks for the fix!

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

Successfully merging a pull request may close this issue.

3 participants