package glob
import "src.elv.sh/pkg/glob"
Package glob implements globbing for elvish.
Index ¶
- Constants
- func Glob(p string, cb func(PathInfo) bool) bool
- func IsLiteral(seg Segment) bool
- func IsSlash(seg Segment) bool
- func IsWild(seg Segment) bool
- func IsWild1(seg Segment, t WildType) bool
- func IsWild2(seg Segment, t1, t2 WildType) bool
- type Literal
- type PathInfo
- type Pattern
- type Segment
- type Slash
- type Wild
- type WildType
Package Files ¶
Constants ¶
Values for WildType.
func Glob ¶
Glob returns a list of file names satisfying the given pattern.
func IsLiteral ¶
IsLiteral returns whether a Segment is a Literal.
func IsSlash ¶
IsSlash returns whether a Segment is a Slash.
func IsWild ¶
IsWild returns whether a Segment is a Wild.
func IsWild1 ¶
IsWild1 returns whether a Segment is a Wild and has the specified type.
func IsWild2 ¶
IsWild2 returns whether a Segment is a Wild and has one of the two specified types.
type Literal ¶
Literal is a series of non-slash, non-wildcard characters, that is to be matched literally.
type PathInfo ¶
type PathInfo struct { // The generated path, consistent with the original glob pattern. It cannot // be replaced by Info.Name(), which is just the final path component. Path string Info os.FileInfo }
PathInfo keeps a path resulting from glob expansion and its FileInfo. The FileInfo is useful for efficiently determining if a given pathname satisfies a particular constraint without doing an extra stat.
type Pattern ¶
Pattern is a glob pattern.
func Parse ¶
Parse parses a pattern.
func (Pattern) Glob ¶
Glob returns a list of file names satisfying the Pattern.
type Segment ¶
type Segment interface {
// contains filtered or unexported methods
}
Segment is the building block of Pattern.
type Slash ¶
type Slash struct{}
Slash represents a slash "/".
type Wild ¶
Wild is a wildcard.
func (Wild) Match ¶
Match returns whether a rune is within the match set.
type WildType ¶
WildType is the type of a Wild.
Package glob imports 5 packages (graph) and is imported by 1 packages. Updated 1 month ago.
Tools for package owners.