Bat: Output looks unbalanced when using '--style=grid,numbers' without 'header'.

Created on 25 May 2019  路  4Comments  路  Source: sharkdp/bat

The output looks a bit unbalanced when it's only printing the bottom horizontal line.

image

Would it make more sense to only print that final horizontal line when the header component is enabled?

feature-request good first issue help wanted

Most helpful comment

I think I actually prefer option 1: all lines. Let's print a grid if the user asks for it :smile:

All 4 comments

Thank you for reporting this. It does look unbalanced, I agree.

If we skip the line completely, we wouldn't have any separation between different files. I think we should rather add a line on top?

I think ideally we would use one of the following formats:

(All lines):

-----------------------------------
 1 | // This is file A
 2 | // ...
-----------------------------------
 1 | // This is file B
 2 | // ...
-----------------------------------

(Separator lines):

 1 | // This is file A
 2 | // ...
-----------------------------------
 1 | // This is file B
 2 | // ...

The all lines format would look better with multiple files, but it feels a bit excessive to add the horizontal separator lines at the top and bottom for only a single file. Maybe a hybrid approach that uses all lines if more than one input file is given, but no lines otherwise?

$bat fileA.txt
 1 | // This is file A
 2 | // ...

$bat fileA.txt fileB.txt
-----------------------------------
 1 | // This is file A
 2 | // ...
-----------------------------------
 1 | // This is file B
 2 | // ...
-----------------------------------

I think I actually prefer option 1: all lines. Let's print a grid if the user asks for it :smile:

Fixed in bat v0.12.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

issmirnov picture issmirnov  路  3Comments

scalp42 picture scalp42  路  3Comments

jkaan picture jkaan  路  3Comments

samuelcolvin picture samuelcolvin  路  3Comments

mjlbach picture mjlbach  路  3Comments