Open kadrach opened 6 years ago
@kadrach Excuse the delay, we took some time off.
Indeed we do some automated adjusting.The way it works is:
So the wrapping takes place before.
We could maybe indeed have a flag --no-linewrap
. Also another idea with a --short-arn
flag since the issue is often with arn that contain too much information and often the suffix is necessary.
We will see if we include one of those flags in the 0.1.11 release, unless the --columns
flag (see description below) solves the problem for you as it was intended for that.
Let us know.
(Note the --columns
flag in the listing can help you a bit in the meantime since you can select which fields are displayed. For instance awless list stacks --columns id,name,created
would fit better in the terminal)
Forgot to mention as well, but @kadrach you might be aware of it.
To avoid line wrapping you can display other supported formats. For instance:
awless list stacks --format json
# or
awless list stacks --format csv
# or
awless list stacks --format tsv
Thank you for elaborating @simcap!
Enough space -> display Not enough space -> Do line wrap on fields that are wrapable (given a max width) then display
Not sure if I understand the current functionality properly. Here's my terminal and the output of list stacks
(blacked out first two columns - you can see the line wrapping from height of rows).
Does max_width
relate to the maximum width of a wrapped column? Why not wrap such that space is utilized most efficiently?
I would be interested to know how the wrapping logic works when piping or redirecting:
$ awless list certificates
| ARN ▲ | NAME |
|-------------------------------------------------------------------------------------|----------------------|
| arn:aws:acm:us-east-1:111111111111:certificate/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee | *.some-domain-zz.com |
$ awless list certificates | grep -v zzzzz
| ARN ▲ | NAME |
|-------------------------------------|----------------------|
| arn:aws:acm:us-east-1:111111111111: | *.some-domain-zz.com |
| certificate/aaaaaaaa-bbbb-cccc- | |
| dddd-eeeeeeeeeeee | |
$ awless list certificates >file1 ; cat file1
| ARN ▲ | NAME |
|-------------------------------------|----------------------|
| arn:aws:acm:us-east-1:111111111111: | *.some-domain-zz.com |
| certificate/aaaaaaaa-bbbb-cccc- | |
| dddd-eeeeeeeeeeee | |
It would be nice if there was no wrapping done at all when piping or redirecting the output in table format.
It would be very useful indeed to turn off wrapping when stdout is not a tty
awless list stacks
spits out a table 118 characters wide. As CloudFormation ARNs are rather long, this results in theID
column wrapping over 4 lines, resulting in a very long output table.tput cols
returns218
on my monitor/terminal/font size setup.The output is already adjusted based on width, as it appropriately truncates columns when the terminal is much less wide. It would be nice if
awless
dynamically adjusted for wider terminals as well, or perhaps an option to disable line-wrapping inside columns?67d5b579e35e8d813a871f7f739c4b74b8b52c1b suggests this is already happening, but unfortunately this does not work for me.