Skip to content

feat: add ln=target link colours and configurable filename quoting - #31

Merged
fxrdhan merged 2 commits into
mainfrom
feat/upstream-ports-pr31
Aug 22, 2026
Merged

feat: add ln=target link colours and configurable filename quoting#31
fxrdhan merged 2 commits into
mainfrom
feat/upstream-ports-pr31

Conversation

@fxrdhan

@fxrdhan fxrdhan commented Aug 22, 2026

Copy link
Copy Markdown
Owner
Description

This PR ports two user-facing features from eza-community/eza into lsr, one atomic commit per item:

  1. 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=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 becomes 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 now understands the literal target).
    • Hardening over upstream: target resolution reuses a shared per-file style helper instead of reconstructing a temporary FileName, so chained or missing targets can never panic — broken targets fall back to or=, absent ones stay unstyled.
  2. Commit 559a7deb: feat(options): add --quotes flag and quoting-style environment variable (ported from eza-community/eza#587)

    • Replaces 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.
    • New LSR_QUOTING_STYLE / EZA_QUOTING_STYLE environment variable supplies the default; the command line overrides it, invalid values fall back to auto. The old flag stays as a hidden compatibility alias.
    • Adapted to lsr's clap architecture (upstream's diff predates it) and routed through the mockable Vars trait rather than raw std::env for testability.
    • Updates all five shell completions, both man pages (--quotes + env var section), and the README.
Quality Gates
  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features — 0 warnings
  • cargo test --workspace — all green (new: ls_ln_target, borrow/orphan paint tests, 6 quote deduce tests)
  • reuse lint — 100% compliant
  • Conventional Commits

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.
@fxrdhan
fxrdhan merged commit aff2494 into main Aug 22, 2026
12 checks passed
@fxrdhan
fxrdhan deleted the feat/upstream-ports-pr31 branch August 23, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant