dust icon indicating copy to clipboard operation
dust copied to clipboard

Config file does not support the `collapse` option

Open ofek opened this issue 1 month ago • 4 comments

Hey there, thanks for this great tool! I'm trying to add it to our developer environments with certain directories collapsed by default like .git but only the flag appears to work.

❯ dust -bn 4 -d 2 --collapse .git
 29M   ┌── test
 55M   ├── .git
 41M   │ ┌── dyninst
149M   ├─┴ pkg
309M ┌─┴ .

❯ $env.DC
/root/.config/dust/config.toml

❯ echo "collapse=\".git\"\n" o> $env.DC; cat $env.DC; dust -bn 4 -d 2
collapse=".git"
 53M     ┌── objects
 55M   ┌─┴ .git
 41M   │ ┌── dyninst
149M   ├─┴ pkg
309M ┌─┴ .

❯ echo "collapse=[\".git\"]\n" o> $env.DC; cat $env.DC; dust -bn 4 -d 2
collapse=[".git"]
 53M     ┌── objects
 55M   ┌─┴ .git
 41M   │ ┌── dyninst
149M   ├─┴ pkg
309M ┌─┴ .

ofek avatar Nov 19 '25 02:11 ofek

I didn't think anyone would ever want a config option for that. Happy to add it if you want it.

bootandy avatar Nov 20 '25 22:11 bootandy

just to be clear :

the command line option: --collapse works correctly.

You want this option to be added to config as well ?

bootandy avatar Nov 20 '25 22:11 bootandy

Yes, please! I'm unfamiliar with the code base, is there any reason to not support every option in the config file?

ofek avatar Nov 20 '25 22:11 ofek

No reason. I just didn't think anyone would want to have a directory collapsed permanently so I never added it.

bootandy avatar Nov 20 '25 22:11 bootandy