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

(exa PR) 1102: Make -t work like ls when used with no args #37

Closed
wants to merge 1 commit into from

Conversation

cafkafk
Copy link
Member

@cafkafk cafkafk commented Jul 29, 2023

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/exa#519
@sbatial
Copy link
Collaborator

sbatial commented Jul 29, 2023

I've looked into this and it seems to work fine for me.

I tested against ls -t --sort none and ls --sort none -t and as far as I can tel ls takes the last argument given into account.

exa does currently work with --sort=inode -t (sorting by inode) but failing with -t --sort=inode ("Option --time (-t) has no "--sort=inode" setting")

I'm willing to make this work.

@cafkafk cafkafk changed the title (exa PR) 1102 (exa PR) 1102: Make -t work like ls when used with no args Jul 29, 2023
@cafkafk
Copy link
Member Author

cafkafk commented Jul 29, 2023

I'm willing to make this work.

Awesome, do you need any perms to commit to this PR?

@sbatial
Copy link
Collaborator

sbatial commented Jul 29, 2023

err.. probably.
I would have just opened a pull pointing to this one I think

@cafkafk
Copy link
Member Author

cafkafk commented Jul 29, 2023

err.. probably. I would have just opened a pull pointing to this one I think

Cool, whatever works best for you!

@cafkafk cafkafk added enhancement New feature or request not ready for PRs that aren't finished labels Jul 29, 2023
@sbatial
Copy link
Collaborator

sbatial commented Jul 29, 2023

Two observations: At least on my system (btrfs) exa and ls do not behave the same even when combinations of --time and --sort _are` valid.
I'm not entirely sure which field causes the discrepancy.

But the current error is not caused by any inconsistencies. It just parses --sort... as the argument for -t which does not work.

So I'd propose to make -t work without an argument and with other options behind it and put "1:1 ls compat" off to another issue/pull/discussion if desired.

@cafkafk
Copy link
Member Author

cafkafk commented Jul 29, 2023

So I'd propose to make -t work without an argument and with other options behind it and put "1:1 ls compat" off to another issue/pull/discussion if desired.

Does this mean this PR is merge ready when that change is made? Also, would you like to create the issue, as you probably have a better understanding of the problem?

@sbatial
Copy link
Collaborator

sbatial commented Jul 29, 2023

Yes. Should be ready.

Keeping in mind: that only means that exa now works similar to ls in the sense that when the same arguments are given they try to do the same not that they will necessarily achieve the same result

@sbatial
Copy link
Collaborator

sbatial commented Jul 29, 2023

Also, would you like to create the issue, as you probably have a better understanding of the problem?

You refer to ls compatibility I suppose?
Yep. Can do.

@cafkafk cafkafk added ready and removed not ready for PRs that aren't finished labels Jul 29, 2023
@sbatial
Copy link
Collaborator

sbatial commented Jul 29, 2023

I think it is best to close this or at least block it by until #78 is resolved.

@cafkafk cafkafk marked this pull request as draft July 29, 2023 15:46
@cafkafk cafkafk added not ready for PRs that aren't finished features › arguments and removed enhancement New feature or request ready labels Jul 30, 2023
@sbatial sbatial mentioned this pull request Jul 30, 2023
63 tasks
@cafkafk cafkafk added this to the exa pulls done milestone Jul 31, 2023
@github-actions
Copy link

This pull request is stale because it has been open for 30 days with no activity.

@github-actions
Copy link

This pull request was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this Sep 15, 2023
@cafkafk cafkafk deleted the pr-1102 branch October 12, 2023 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants