eza icon indicating copy to clipboard operation
eza copied to clipboard

default -t to modified -r to be backward compatible with ls

Open p1r473 opened this issue 9 months ago • 4 comments

Hi, Is there any way I can change the default behaviour of eza -t to eza -t modified -r to support backwards-compatibility with ls commands I was going over some old scripts which stopped working and I was digging into why It broke when I switched from ls to eza, the reason being is that ls -t defaulted to modified -r, whereas eza defaults to error

eza: Flag -t needs a value (choices: modified, changed, accessed, created)
To sort newest files last, try "--sort newest", or just "-snew"  

p1r473 avatar May 09 '24 18:05 p1r473

I believe the -t flag is used to select which field to display rather than for sorting. Additionally, I agree that it should maintain backward compatibility. I really hope that the argument design can be revised accordingly.

cosmoswafer avatar Jun 08 '24 05:06 cosmoswafer

I have the same issue. I often have to switch back to ls because of that

ccoVeille avatar Jun 14 '24 02:06 ccoVeille

fwiw eza isn't backwards compatible or a replacement for ls in legacy scripts. we may make a strict compatabilty mode one day, but currently we have a lot of things on our plate to deal with first

cafkafk avatar Jul 16 '24 12:07 cafkafk

in general, ls in scripts can be an anti-pattern to be aware of, unless it's just to show e.g. output to users https://mywiki.wooledge.org/ParsingLs

cafkafk avatar Jul 16 '24 12:07 cafkafk

this is not so much a scripting issue, it affects anyone looking to alias ls=eza for interactive use

i have decades of muscle memory for commands like ls -alrt so this issue makes eza unsuitable for me personally

imo an env flag for a compatibility mode would resolve the issue

turbocrime avatar Oct 22 '24 17:10 turbocrime

imo an env flag for a compatibility mode would resolve the issue

We've discussed this several times, as well as a compatability flag (if feasible), however, while it's very much planned, it's gonna be after the parser is moved, and in general I just think this wont happen soon.

But long term, yea, we want compatibility (optionally, because we (or at least me) do think the ls flags aren't the most intuitive (-h not being help!), muscle memory aside)

cafkafk avatar Nov 01 '24 07:11 cafkafk