Skip to content

Conversation

tslcjames
Copy link

Hi,
when I use kt group tool to get offset from multiple partition topic, it's difficult to see the offset easily
maybe we could print it at pretty format like this?

thanks

@fgeller
Copy link
Owner

fgeller commented Apr 22, 2017

thanks for the feedback and contribution @tslcjames !

context:
i've been using the marshaler without indentation to make sure that a line is a processable unit and leaving the pretty printing to tools like jq. for example, to make sure that you can pipe output from kt consume to kt produce.

your pr made me challenge that thought again. we could probably make pretty printing or not an option (without immediately requiring jq). not sure whether we'd default to pretty printing though. maybe there's a way to detect that output is piped and then fall back to the non pretty printed version? will have to do a bit more digging.

@fgeller
Copy link
Owner

fgeller commented Apr 22, 2017

looks like we can detect whether stdout is a tty via golang.org/x/crypto/ssh/terminal.

then my preferred approach would be to

  • pretty print output by default
  • don't pretty print, when stdout is not a tty
  • add a flag to each command to control/force pretty printing

what do you think @tslcjames ? would start on that soonish, unless you're interested?

@tslcjames
Copy link
Author

thanks for your help @fgeller at #52
I will confirm that soon

@tslcjames tslcjames closed this Apr 24, 2017
@fgeller
Copy link
Owner

fgeller commented Apr 27, 2017

cool, let me know if it doesn't work for you or if you have any other feedback!

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.

3 participants