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

Allow putting directories on top #27

Closed
tomassedovic opened this issue Feb 23, 2015 · 4 comments
Closed

Allow putting directories on top #27

tomassedovic opened this issue Feb 23, 2015 · 4 comments
Assignees
Labels
feature request New features to add to exa

Comments

@tomassedovic
Copy link
Contributor

ls has the --group-directories-first option which prints the directories first (sorted by name) and files after:

$ ls -1 --group-directories-first
src
target
Cargo.lock
Cargo.toml
LICENCE
README.md
screenshot.png

vs.

$ exa -1
Cargo.lock
Cargo.toml
LICENCE
README.md
screenshot.png
src
target

Could something like this be added to exa? It would probably have to be a separate switch (since you can only have a single sort, but putting directories first is orthogonal to e.g. sorting by an extension).

@ogham ogham added the feature request New features to add to exa label Feb 23, 2015
@ogham
Copy link
Owner

ogham commented Feb 23, 2015

If ls does it, there's no reason why exa shouldn't.

@ogham ogham self-assigned this Feb 23, 2015
@tomassedovic
Copy link
Contributor Author

Awesome, thanks :-).

What's the general approach with ls-compatibility? Some of the options are already different: -h in ls means "show file sizes in a human readable format" which exa does by default and there it means "show the header row".

Are you shooting for a similar feature set (but nicer defaults and new stuff like the git support) but possibly different options? Or is it more of a case-by-case thing?

@ogham
Copy link
Owner

ogham commented Feb 24, 2015

It's more the former, but there will be things I'll have to decide on a case-by-case basis. In a way, I'm thinking: if it were up to me to write ls, how would I write it? I would have used prefixes by default, since that's what you want >99% of the time - which just happens to free up -h. I think showing groups by default clutters up the output, so instead of having an option to take them away, there's an option to add them. However, I also get the benefit that exa isn't installed by default, so I get to add features like Git support that some people would consider "bloat".

Just because ls has something doesn't automatically mean that exa should support it too - but it looks like showing directories first is a popular-enough option that it should be included. (For what it's worth, I have no idea why anyone would ever choose that option, but as long as some people like it!)

@ogham
Copy link
Owner

ogham commented Feb 26, 2015

screen shot 2015-02-26 at 14 03 20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New features to add to exa
Projects
None yet
Development

No branches or pull requests

2 participants