glob

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2017 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package glob implements globbing for elvish.

Index

Constants

View Source
const (
	Question = iota
	Star
	StarStar
)

Values for WildType.

Variables

This section is empty.

Functions

func Glob

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

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

func IsLiteral added in v0.6.0

func IsLiteral(seg Segment) bool

func IsSlash added in v0.6.0

func IsSlash(seg Segment) bool

func IsWild added in v0.6.0

func IsWild(seg Segment) bool

func IsWild1 added in v0.6.0

func IsWild1(seg Segment, t WildType) bool

func IsWild2 added in v0.6.0

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

Types

type Literal

type Literal struct {
	Data string
}

type Pattern

type Pattern struct {
	Segments    []Segment
	DirOverride string
}

Pattern is a glob pattern.

func Parse

func Parse(s string) Pattern

Parse parses a pattern.

func (Pattern) Glob

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

Glob returns a list of file names satisfying the Pattern.

type Segment

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

type Slash

type Slash struct{}

type Wild added in v0.6.0

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

func (Wild) Match added in v0.6.0

func (w Wild) Match(r rune) bool

type WildType added in v0.6.0

type WildType int

WildType is the type of a Wild.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL