fix: align output from classic plugin #660
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A number of minor issues crept in as the output plugins were refactored.
Ensure
padding_lenis greater than 0. When calculating the terminal width, if the output is piped, we can end up with a negative padding length. This results in no space between the filename the size. Setpadding_lento a minimum of 1.The
-lines printed by_getHardRule()are too short when output is not to a terminal, i.e.: when sending to a pager. This turns out to be due to the LINES and COLUMNS being transposed ingetTtySize. When the terminal size cannot be determined, we want to set it to something like 80x24 (COLUMNS x LINES), but instead we set it to 25x78, which results in very short lines from_getHardRule(). Fix the transposition and adjust the values to 79x25 which ensures the output is aligned withprintAudioInfo(). The audio info line uses two hard tabs and has a minimum width of 79 COLUMNS.Fix an off-by-one in the
size_lenvar in_getFileHeader(). We add 4 characters ([&]) rather than 5. This was added in 599eddd (display the ellipsis file name and path, and the file size right justified in printHeader., 2015-10-20), released in 0.7.9.The output is now neatly aligned when output is not directly to a terminal:
$ eyeD3 ~/mp3/tool/ænima/13-ænema.mp3 | cat
/home/foo/mp3/tool/ænima/13-ænema.mp3 [ 14.50 MB ]
Time: 06:40 MPEG1, Layer III [ ~278 kb/s @ 44100 Hz - Joint stereo ]