elvish: github.com/elves/elvish/pkg/cli/lscolors Index | Files

package lscolors

import "github.com/elves/elvish/pkg/cli/lscolors"

Package lscolors provides styling of filenames based on file features.

This is a reverse-engineered implementation of the parsing and interpretation of the LS_COLORS environmental variable used by GNU coreutils.


Package Files

feature.go feature_string.go lscolors.go stat_notsolaris.go stat_unix.go

func F Uses

func F(name string) string

func WithTestLsColors Uses

func WithTestLsColors() func()

WithTestLsColors sets LS_COLORS to a value where directories are blue and .png files are red. It returns a function to restore the old value. This function is mainly useful in tests.

type Colorist Uses

type Colorist interface {
    // GetStyle returns the style for the named file.
    GetStyle(fname string) string

Colorist styles filenames based on the features of the file.

func GetColorist Uses

func GetColorist() Colorist

Package lscolors imports 7 packages (graph) and is imported by 2 packages. Updated 2019-12-23. Refresh now. Tools for package owners.