ogham / exa

A modern replacement for ‘ls’.
https://the.exa.website/
MIT License
23.51k stars 660 forks source link

Option --tree (-T) should not conflict with --list-dirs (-d) #1176

Closed docwhat closed 1 year ago

docwhat commented 1 year ago

When using exa -dT it acts the same as running exa -T.

This seems to be because it is ignoring the -d flag.

If I run in strict mode I get:

$ env EXA_STRICT=1 exa -dT
exa: Option --tree (-T) conflicts with option --list-dirs (-d)

I expected this to work the same a tree does and just show the directories but not the files.

# example of tree
$ tree -d
.
├── apache2
│   ├── extra
│   ├── original
│   │   └── extra
│   ├── other
│   └── users
├── defaults
├── manpaths.d
├── pam.d
├── paths.d
├── periodic
│   ├── daily
│   ├── monthly
│   └── weekly
├── ssh
│   ├── ssh_config.d
│   └── sshd_config.d
├── ssl
│   └── certs
├── sudoers.d
├── uucp
└── wfs

11 directories

Note how it only counts the directories at the top.

eggbean commented 1 year ago

The -d switch is for it to not show the directory contents when globbing. like in ls.

e.g. If you want to show all the hidden files in your home directory, the first options would also give you everything inside the hidden directories. With the -d switch they don't.

$ ls -l .*
$ exa -l .*

$ ls -ld .*
$ exa -ld .*

So, it doesn't make much sense for the -d switch to be used in tree mode, as the contents of directories aren't being shown.

The -D switch is what you want.

docwhat commented 1 year ago

I missed the -D/--only-dirs flag in the manpage.

That is exactly what I wanted.