Skip to content

Make -t work like ls when used with no args#1102

Closed
WhyNotHugo wants to merge 1 commit into
ogham:masterfrom
WhyNotHugo:ls-compatible-dash-t
Closed

Make -t work like ls when used with no args#1102
WhyNotHugo wants to merge 1 commit into
ogham:masterfrom
WhyNotHugo:ls-compatible-dash-t

Conversation

@WhyNotHugo

Copy link
Copy Markdown

Currently exa can't work as a drop-in ls replacement due to -t
having a very different behaviour.

However -t currently only work when used with a value, and is invalid
when used without any value.

This patch changes the behaviour of -t when used with no arguments to
behave exactly like it does for ls. When used with a value, it
continues behaving as in previous versions of exa.

Fixes: #519

@WhyNotHugo

WhyNotHugo commented Aug 9, 2022

Copy link
Copy Markdown
Author

This isn't in a ready-to-merge state:

  • Formatting needs to be fixed, but running rust fmt will mess up all the existing formatting which I'm sure would be unacceptable. I think the formatting is okay and matches the rest of the code.
  • There are no tests. After reading all the work put into test, I'm pretty sure that's mandatory for merging.

However, I'm presenting this here early mostly to hear feedback on the approach. I can't decide if this is a beautiful fix, a horrible hack, or somehow, both at the same time.

@WhyNotHugo

Copy link
Copy Markdown
Author

Oh, I'm not sure what should be done when --sort is passed and -t with no value is passed; it seems one would be redundant.

Currently exa can't work as a drop-in `ls` replacement due to `-t`
having a very different behaviour.

However `-t` currently only works when used with a value, and is invalid
when used without any value.

This patch changes the behaviour of exa when `-t` is passed with no
value to behave the same as ls. When used with a value, it continues
behaving as in previous versions of `exa`.

Fixes: #519
@WhyNotHugo

Copy link
Copy Markdown
Author

@ariasuni Any feedback for me here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make -t without arguments behave like in ls

1 participant