[GH-ISSUE #312] --depth overrides default for --number-of-lines #133

Closed
opened 2026-06-08 11:25:49 +03:00 by zhus · 3 comments
Owner

Originally created by @asomers on GitHub (Feb 17, 2023).
Original GitHub issue: https://github.com/bootandy/dust/issues/312

By default, dust chooses a good value for --number-of-lines. But if I also use --depth, then dust acts as though --number-of-lines is unlimited, and prints everything. Shouldn't it still use a reasonable number?

FreeBSD 14.0-CURRENT amd64, Dust 0.8.1.

Originally created by @asomers on GitHub (Feb 17, 2023). Original GitHub issue: https://github.com/bootandy/dust/issues/312 By default, dust chooses a good value for `--number-of-lines`. But if I also use `--depth`, then dust acts as though `--number-of-lines` is unlimited, and prints everything. Shouldn't it still use a reasonable number? FreeBSD 14.0-CURRENT amd64, Dust 0.8.1.
zhus closed this issue 2026-06-08 11:25:50 +03:00
Author
Owner

@bootandy commented on GitHub (Feb 19, 2023):

I decided that using--depthmeant the user wanted to go see everything to that level.

If --depth assumed the default number of lines of output it could lead to strange behaviour.

  • If you choose --depth=1 and there is one directory and two files. Should it only show 3 entries or should it open the directory and go into lower depths too?

  • If you select depth=3 and all the big files are at depth=1 then does it only show the big files at depth=1 and not go down to show you the directory structure of the nested directories?

I wrestled with the above ideas and thought that if you want a correct --number-of-lines you probably don't want to use --depth at all. Just run dust normally.

<!-- gh-comment-id:1435970840 --> @bootandy commented on GitHub (Feb 19, 2023): I decided that using` --depth `meant the user wanted to go see everything to that level. If `--depth` assumed the default number of lines of output it could lead to strange behaviour. * If you choose `--depth=1` and there is one directory and two files. Should it only show 3 entries or should it open the directory and go into lower depths too? * If you select `depth=3` and all the big files are at depth=1 then does it only show the big files at depth=1 and not go down to show you the directory structure of the nested directories? I wrestled with the above ideas and thought that if you want a correct `--number-of-lines` you probably don't want to use `--depth` at all. Just run dust normally.
Author
Owner

@asomers commented on GitHub (Feb 19, 2023):

Fair enough. In my case, all of the big files are many levels down, but I only want to see the size of directories at the depth I specify. For that case, --number-of-lines makes sense.

<!-- gh-comment-id:1435998165 --> @asomers commented on GitHub (Feb 19, 2023): Fair enough. In my case, all of the big files are many levels down, but I only want to see the size of directories at the depth I specify. For that case, --number-of-lines makes sense.
Author
Owner

@bootandy commented on GitHub (Feb 22, 2023):

you can run "dust dir1 dir2 dir3" and it will do one run on those 3 directories.

<!-- gh-comment-id:1439634606 --> @bootandy commented on GitHub (Feb 22, 2023): you can run "dust dir1 dir2 dir3" and it will do one run on those 3 directories.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#133