elvish: github.com/elves/elvish/pkg/glob Index | Files

package glob

import "github.com/elves/elvish/pkg/glob"

Package glob implements globbing for elvish.

Index

Package Files

glob.go parse.go pattern.go

Constants

const (
    Question = iota
    Star
    StarStar
)

Values for WildType.

func Glob Uses

func Glob(p string, cb func(string) bool) bool

Glob returns a list of file names satisfying the given pattern.

func IsLiteral Uses

func IsLiteral(seg Segment) bool

IsLiteral returns whether a Segment is a Literal.

func IsSlash Uses

func IsSlash(seg Segment) bool

IsSlash returns whether a Segment is a Slash.

func IsWild Uses

func IsWild(seg Segment) bool

IsWild returns whether a Segment is a Wild.

func IsWild1 Uses

func IsWild1(seg Segment, t WildType) bool

IsWild1 returns whether a Segment is a Wild and has the specified type.

func IsWild2 Uses

func IsWild2(seg Segment, t1, t2 WildType) bool

IsWild2 returns whether a Segment is a Wild and has one of the two specified types.

type Literal Uses

type Literal struct {
    Data string
}

Literal is a series of non-slash, non-wildcard characters, that is to be matched literally.

type Pattern Uses

type Pattern struct {
    Segments    []Segment
    DirOverride string
}

Pattern is a glob pattern.

func Parse Uses

func Parse(s string) Pattern

Parse parses a pattern.

func (Pattern) Glob Uses

func (p Pattern) Glob(cb func(string) bool) bool

Glob returns a list of file names satisfying the Pattern.

type Segment Uses

type Segment interface {
    // contains filtered or unexported methods
}

Segment is the building block of Pattern.

type Slash Uses

type Slash struct{}

Slash represents a slash "/".

type Wild Uses

type Wild struct {
    Type        WildType
    MatchHidden bool
    Matchers    []func(rune) bool
}

Wild is a wildcard.

func (Wild) Match Uses

func (w Wild) Match(r rune) bool

Match returns whether a rune is within the match set.

type WildType Uses

type WildType int

WildType is the type of a Wild.

Package glob imports 5 packages (graph) and is imported by 1 packages. Updated 2019-12-23. Refresh now. Tools for package owners.