Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WhyNotHugo
Copy link

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
Copy link
Author

WhyNotHugo commented Aug 9, 2022

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
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: ogham#519
@WhyNotHugo
Copy link
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