func NewOptions()

in pkg/proposal/options.go [33:53]


func NewOptions(kep, sig, name, number string) (*Options, error) {
	if kep == "" {
		return nil, errors.New("must provide a path for the new KEP like sig-architecture/0000-new-kep")
	}

	re := regexp.MustCompile(`([a-z\\-]+)/((\\d+)-.+)`)
	matches := re.FindStringSubmatch(kep)

	if matches == nil || len(matches) != 4 {
		return nil, errors.New(
			fmt.Sprintf("invalid KEP name: %s", kep),
		)
	}

	return &Options{
		KEP:    kep,
		SIG:    sig,
		Name:   name,
		Number: number,
	}, nil
}