Exa: --list-dirs only listing '.' directory

Created on 4 Aug 2017  Â·  6Comments  Â·  Source: ogham/exa

On Mac OS 10.12.6, I installed exa via Homebrew just now. Here is a sample session:

~ $ uname -a
Darwin redacted-machine-name.local 16.7.0 Darwin Kernel Version 16.7.0:
 Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
~ $ echo $BASH_VERSION
4.4.12(1)-release
~ $ exa --version
exa 0.7.0
~ $ exa
Applications  Documents  Dropbox  Movies  Pictures  gurobi.lic  venv
Desktop       Downloads  Library  Music   Public    octave      
~ $ exa --list-dirs
.
features › arguments

Most helpful comment

Yeah, it is confusing, and your example does make it seem as though it should just list the directories. I'm going to make that option's description more clear. I'll consider changing the long name, too: there's a feature request for actually only displaying the directories, and if we had both, well, I know I'd mix them up.

Either way you should keep -d as the short flag because that's compatible with ls.

Definitely. I think more people know it as d than as list-dirs anyway.

All 6 comments

Were you expecting --list-dirs to only list the directories? It's got a bit of an awkward name — what the flag does is list directories as files instead of recursing into them, so if you ran exa Documents, you'd see one row for the Documents folder instead of several rows for its contents. And if you call exa with no arguments it'll list the current folder, which is why it's listing "." here.

Oh, I get it. I was confused by what the man page meant by "list directories like regular files". Perhaps it would be clearer with a flag name such as --no-recursion, --no-recur, or --no-dir-contents with a description "list directories as though they were regular files _without_ recursion into them to list their contents".

I had never bothered to read the man page for ls (if I had, we wouldn't be here), but here's what it says about -d: "Directories are listed as plain files (not searched recursively)." That would be okay too.

Either way you should keep -d as the short flag because that's compatible with ls.

Yeah, it is confusing, and your example does make it seem as though it should just list the directories. I'm going to make that option's description more clear. I'll consider changing the long name, too: there's a feature request for actually only displaying the directories, and if we had both, well, I know I'd mix them up.

Either way you should keep -d as the short flag because that's compatible with ls.

Definitely. I think more people know it as d than as list-dirs anyway.

The wording in the ls man page is quite clear (to me): "list directories themselves, not their contents"

It's the "not their contents" part that is present in ls's man page and missing from exa's man page.

2 years ago It's mentioned but not changed yet. any plans to update description on -d?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

skyzyx picture skyzyx  Â·  4Comments

MohamedElm1678 picture MohamedElm1678  Â·  3Comments

jbergstroem picture jbergstroem  Â·  4Comments

anishmittal2020 picture anishmittal2020  Â·  5Comments

dbohdan picture dbohdan  Â·  6Comments