mikr/whatstyle

Stdout redirection

lassik opened this issue · 3 comments

Thanks for this extremely useful tool!

Would be nice if the following did the obvious thing:

whatstyle foo.c >.clang-format

Currently progress messages with ANSI codes are written to standard output so they go into the output file if you try to do that. Would it work if the progress messages went to stderr instead?

Well, I didn't think through my feature request. You output progressively finer clang-format configs to stdout so all but the last one should either be commented out with # or be written to stderr instead of stdout.

mikr commented

Thank you!
There is an option that saves the resulting style into a file. In your case you can run
whatstyle --output .clang-format foo.c
to get the same result without any redirection.

True. That's what I ended up using :)