-
Notifications
You must be signed in to change notification settings - Fork 185
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
pkg/columns: Do not elide output when redirected. #2451
Conversation
Thanks for working on this, it will be nice to have this. Also, what do you think about combining it with --no-trunc ? |
Maybe this should rather become an Otherwise we lose the possibility of formatting output for other targets (e.g. when used as a service and sending formatted output to another logserver or such), because only the local environment would be considered. |
b991ec7
to
c266274
Compare
I just added the $ sudo -E ./ig image list | awk '{ printf "%s:%s\n", $1, $2 }' | tail -2
INFO[0000] Experimental features enabled
blocks:latest
ghcr.io/inspektor-gadget/gadgets/blocks:latest
$ sudo -E ./ig image list | awk '{ printf "%s:%s\n", $1, $3 }' | tail -2
INFO[0000] Experimental features enabled
blocks:sha256:2bea84b83af28cd47302dcf37fe115327637974c9db4d490b5a59c65df4c190c
ghcr.io/inspektor-gadget/gadgets/blocks:sha256:2bea84b83af28cd47302dcf37fe115327637974c9db4d490b5a59c65df4c190c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! I'd just rename the field + option as it now just decides whether or not to shorten/truncate the string, not whether an ellipsis is used.
When used in Inspektor Gadget, output will not be truncated if it is not a terminal. Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
c266274
to
47d20c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Thank you for the review! |
Hi.
This PR removes ellipsis when the output is not a terminal:
Best regards.