Skip to content

thomasheller/braceexpansion

Repository files navigation

braceexpansion

Build Status Go Report Card Coverage Status

Shell brace expansion implemented in Go (golang).

Supports some specialties required by multigoogle.

Numeric ranges are currently not supported, as I didn't need them. Feel free to send a PR.

Build

$ cd cmd && go build -o be

Usage (command line):

$ be '{a,b}{1,2}'
a1
a2
b1
b2

Usage (library):

import (
	be "github.com/thomasheller/braceexpansion"
	"fmt"
)

func main() {
	tree, err := be.New().Parse("{a,b}{1,2}")
	if err != nil {
		panic(err)
	}
	for _, s := range tree.Expand() {
		fmt.Println(s)
	}
	
	// Output:
	// a1
	// a2
	// b1
	// b2
}

About

Shell brace expansion in Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages