[][src]Crate lscolors

A library for colorizing paths according to the LS_COLORS environment variable.

Example

use lscolors::{LsColors, Style};

let lscolors = LsColors::from_env().unwrap_or_default();

let path = "some/folder/archive.zip";
let style = lscolors.style_for_path(path);

// If you want to use `ansi_term`:
let ansi_style = style.map(Style::to_ansi_term_style).unwrap_or_default();
println!("{}", ansi_style.paint(path));

Re-exports

pub use crate::style::Color;
pub use crate::style::FontStyle;
pub use crate::style::Style;

Modules

style

A module for ANSI styles

Structs

LsColors

Holds information about how different file system entries should be colorized / styled.

StyledComponents

Iterator over the path components with their respective style.

Enums

Indicator