Add configuration and CLI options: truncate owner #905
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! This is my first attempt to contribute something meaningful to this project so I don't know I'm doing it right. Thank you in advance for your feedback.
This adds the following CLI flags:
--truncate-owner-after
--truncate-owner-marker
And the following configuration fields:
The default behavior of LSD is unchanged.
The problem this change attempts to solve is the usability of the
-l
flag on systems where some user or group names are long but cannot be changed (e.g. the user is not admin and the account is managed in a central directory). In such cases, even with a decently sized terminal (90+ characters wide), lines often overflow, making the directory listing hard to read.Without this change, the only mitigation would consist in turning off the display of file ownership (via the
blocks
configuration field) which is unsatisfactory because ownership information is very useful.Default settings (the length of user/group name may seem exaggerated but it's actually the same length as my user/group name on machines I have to use):
With
--truncate-owner-after 7 --truncate-owner-marker …
:TODO
cargo fmt