feat: add ln=target link colours and configurable filename quoting - #31
Merged
Conversation
ln=target colours a symbolic link the same way as the file it points at instead of using a fixed link style; orphaned links keep the broken-symlink colour. The link kind style is now a LinkStyle that is either an explicit ANSI style or the target-following mode, accepted from both LS_COLORS/EZA_COLORS and theme.yml (filekinds.symlink).
Replace the boolean --no-quotes switch with --quotes=(always|auto| never), mirroring GNU ls quoting styles: auto wraps only names with spaces or quotes, always quotes every name, never quotes nothing. The old flag stays as a hidden compatibility alias, and a new LSR_QUOTING_STYLE / EZA_QUOTING_STYLE environment variable supplies the default that the command line overrides. Update the five shell completions, both man pages, and the README.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR ports two user-facing features from eza-community/eza into
lsr, one atomic commit per item:Commit
eae525eb:feat(theme): support ln=target in LS_COLORS(ported from eza-community/eza#1018, itself a port of Support ln=target in LS_COLORS (#774) ogham/exa#960)ln=targetcolours a symbolic link the same way as the file it points at instead of using a fixed link style; orphaned links keep the broken-symlink colour.LinkStylethat is either an explicit ANSI style or the target-following mode, accepted from bothLS_COLORS/EZA_COLORSandtheme.yml(filekinds.symlinknow understands the literaltarget).FileName, so chained or missing targets can never panic — broken targets fall back toor=, absent ones stay unstyled.Commit
559a7deb:feat(options): add --quotes flag and quoting-style environment variable(ported from eza-community/eza#587)--no-quotesswitch with--quotes=(always|auto|never), mirroring GNU ls quoting styles:autowraps only names with spaces or quotes,alwaysquotes every name,neverquotes nothing.LSR_QUOTING_STYLE/EZA_QUOTING_STYLEenvironment variable supplies the default; the command line overrides it, invalid values fall back toauto. The old flag stays as a hidden compatibility alias.Varstrait rather than rawstd::envfor testability.--quotes+ env var section), and the README.Quality Gates
cargo fmt --all -- --checkcargo clippy --all-targets --all-features— 0 warningscargo test --workspace— all green (new:ls_ln_target, borrow/orphan paint tests, 6 quote deduce tests)reuse lint— 100% compliant