I very much like the output of exa --long --grid when there are many (>50) items in a folder. However, it looks rather silly to have three or even four columns when there are less than 10 items. Can --grid be automatically disabled when there only a few items to list?
Good idea! It does look a bit weird when four files are in four columns.
I'm going to give the grid flag an optional argument that specifies how many files there need to be before grid mode gets activated.
Sounds great. Another consideration might be an option that specifies how many rows there need to be for grid mode to activate, since while grid might look good on a small display, it might be stretched out much farther (and with fewer rows) on a large display. Or for example, enabling --long drastically decreases the number of columns, which increases the number of rows and makes grid look better.
I couldn't get exa's command-line parser to deal with optional options properly, so I chickened out and made it an environment variable instead: EXA_GRID_ROWS. Setting this number means it'll revert to just the --long view if --long --grid doesn't output enough rows (which I did think is better than just going by the file count)
It works great, thanks. Unfortunately the new behavior is incompatible with --header; is this a known limitation?
any plans on replacing that with clap? that could save a bunch of code
Most helpful comment
Sounds great. Another consideration might be an option that specifies how many rows there need to be for grid mode to activate, since while grid might look good on a small display, it might be stretched out much farther (and with fewer rows) on a large display. Or for example, enabling
--longdrastically decreases the number of columns, which increases the number of rows and makes grid look better.