wasm-tools icon indicating copy to clipboard operation
wasm-tools copied to clipboard

Colorize section types in `dump` output

Open maekawatoshiki opened this issue 1 year ago • 2 comments

Thank you for developing great tools.

I found that wasm-tools dump is really useful, but coloring the output, especially the section entries such as type section, would make it more readable.

However, I'm not sure if it is acceptable for the output to contain escape codes for coloring. What do you think?

image

maekawatoshiki avatar May 10 '23 15:05 maekawatoshiki

I think it'd be great to add color! This is a central structure which could grow a --color argument and the output_writer method could perhaps return a WriteColor trait object instead of a Write trait object to allow callers to customize colors.

Personally I find colors make it much easier to explore lots of output, so I'm all for this. Would you be up for prototyping this in a PR?

alexcrichton avatar May 10 '23 15:05 alexcrichton

Glad to hear that. I'll try to create a PR for it.

maekawatoshiki avatar May 10 '23 15:05 maekawatoshiki