-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat(journal): add "truncate-field"/"truncate-all-fields" flags #164
base: main
Are you sure you want to change the base?
feat(journal): add "truncate-field"/"truncate-all-fields" flags #164
Conversation
f465402
to
25a5828
Compare
816ed09
to
2e23130
Compare
Signed-off-by: Jason Jerome <jajerome@redhat.com>
Signed-off-by: Jason Jerome <jajerome@redhat.com>
2e23130
to
e1c1beb
Compare
Is the Edit: confirmed for myself; yes, the WorkerEvent.Data field is always parsable as JSON (Go declares it as |
So there's just something odd about these flags that I can't put into words yet. I looked over the CLIG and read the section on command line arguments and flags. It links to some of its source material, which includes an article on good CLI design decisions. This article has a section on table usage. This section talks about output formatting, and includes the following:
Because the table is an interactive output format, perhaps we should default to dynamic truncation, and allow the user to simply pass a |
Thanks for the resources, that's definitely a fundamental change to this PR and I agree this is worth having a design discussion first. |
I put some thought into this finally. And started a discussion about it (#215). |
Do not merge before: #116
This feature implements the
--truncate-field
/--tf
and--truncate--all-fields
/--taf
flags.The
--truncate-field
flag allows users to truncate worker data contentfor the specified field to the character count provided.
The
--truncate-all-fields
flag allows users to truncate all worker data content fieldsto the character count provided.
The
--truncate-field
flag can be used multiple times to truncate contentfor multiple fields.
Example usage:
Regular usage w/o truncating any data fields:
Input:
yggctl message-journal
Output:
Usage w/ truncating a single data field:
Input:
yggctl message-journal --truncate-field message=5
Output:
Usage w/ truncating multiple data fields:
Input:
yggctl message-journal --tf fieldA=2 --tf fieldB=1 --tf fieldC=5
Output:
Usage w/ truncating ALL data fields:
Input:
yggctl message-journal --taf 5
Output: