glob

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2016 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package glob implements globbing for elvish.

Index

Constants

This section is empty.

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.

Types

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 struct {
	// Type of the Segment.
	Type SegmentType
	Data string // For Literal, the literal string. For Question, Star and StarStar, nonempty if they should match all files.
}

Segment is the constituent unit of a Pattern.

type SegmentType

type SegmentType int

SegmentType is the type of a Segment.

const (
	Literal SegmentType = iota
	Slash
	Question
	Star
	StarStar
)

Values for SegmentType.

Jump to

Keyboard shortcuts

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