Skip to content

Latest commit

 

History

History
54 lines (42 loc) · 1.11 KB

README.md

File metadata and controls

54 lines (42 loc) · 1.11 KB

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
}