ellipses

package
v2.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: AGPL-3.0 Imports: 5 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidEllipsesFormatFn = func(arg string) error {
	return fmt.Errorf("Invalid ellipsis format in (%s), Ellipsis range must be provided in format {N...M} where N and M are positive integers, M must be greater than N,  with an allowed minimum range of 4", arg)
}

ErrInvalidEllipsesFormatFn error returned when invalid ellipses format is detected.

View Source
var ErrInvalidListFormatFn = func(arg string) error {
	return fmt.Errorf("Invalid list format in (%s)", arg)
}

ErrInvalidListFormatFn error returned when invalid list format is detected.

Functions

func HasEllipses

func HasEllipses(args ...string) bool

HasEllipses - returns true if input arg has ellipses type pattern.

func HasList added in v2.0.5

func HasList(args ...string) bool

HasList - returns true if input arg has list type pattern {1,3,5}

Types

type ArgPattern

type ArgPattern []Pattern

ArgPattern contains a list of patterns provided in the input.

func FindEllipsesPatterns

func FindEllipsesPatterns(arg string) (ArgPattern, error)

FindEllipsesPatterns - finds all ellipses patterns, recursively and parses the ranges numerically.

func FindListPatterns added in v2.0.5

func FindListPatterns(arg string) (ArgPattern, error)

FindListPatterns - finds all list patterns, recursively and parses the ranges numerically.

func (ArgPattern) Expand

func (a ArgPattern) Expand() [][]string

Expand - expands all the ellipses patterns in the given argument.

type Pattern

type Pattern struct {
	Prefix string
	Suffix string
	Seq    []string
}

Pattern - ellipses pattern, describes the range and also the associated prefix and suffixes.

func (Pattern) Expand

func (p Pattern) Expand() []string

Expand - expands a ellipses pattern.

Jump to

Keyboard shortcuts

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