mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
[GH-ISSUE #525] number-of-lines option in config file is ignored #229
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wiraki on GitHub (Aug 27, 2025).
Original GitHub issue: https://github.com/bootandy/dust/issues/525
Before I start, thanks for creating
dust, I really like it!Description
The
number-of-linesconfiguration option is not recognized when set in the config file (~/.config/dust/config.tomlor~/.dust.toml). The option works correctly when passed as a command-line argument but is completely ignored when specified inthe configuration file.
I guess this is because:
src/config.rsdoesn't have anumber_of_linesfieldget_number_of_lines()method to merge config and CLI valuessrc/main.rs, the code only checksoptions.number_of_linesdirectly, bypassing the config entirelyAdditionally, in my humble opinion, I find it strange to make the default limit the number of lines based on terminal height. If someone was to use the tool before carefully reading the help, they might miss the fact that the output is automatically truncated by default, and that is not a common behavior of CLI tools, so it is unexpected. While I like the idea to be able to limit the output based on the terminal height, I think that it would be better as a toggle to turn on.
Sorry, I do not have much Rust experience nor the tech stack to make the contribution myself.
Steps to Reproduce
~/.config/dust/config.tomlwith:number-of-lines=999dustwithout any command-line arguments in a directory with many files and subdirectories.Expected Behavior
The
number-of-linessetting from the config file should be respected when no command-line argument is provided, similar to how other options likedepth,reverse, andoutput-formatwork.Actual Behavior
The config file setting is ignored, and
dustalways uses the default behavior (terminal height - 10) unless explicitly overridden via command-line with-lor--number-of-lines.Environment
@sam-kleiner commented on GitHub (Sep 8, 2025):
I think no-percent-bars may have the same issue
I tried:
@vasac commented on GitHub (Sep 26, 2025):
@sam-kleiner config settings use kebab-case -
no-bars=trueshould work.@bootandy commented on GitHub (Oct 6, 2025):
Thanks @vasac yes
you can copy the config file from
config/config.tomlif you need inspiration@bootandy commented on GitHub (Oct 6, 2025):
Yes, it never occurred to me that someone would actually want to do this. But I'm happy to include the PR if you'd like.