bust/pkg/cli/custom.go

20 lines
343 B
Go
Raw Permalink Normal View History

2022-10-30 18:46:00 +01:00
package cli
import (
"context"
"fmt"
"github.com/spf13/cobra"
)
func NewCustomGoBuild(command string, runf func(ctx context.Context) error) error {
cmd := &cobra.Command{
2022-10-31 20:16:26 +01:00
Use: fmt.Sprintf("bust build %s", command),
2022-10-30 18:46:00 +01:00
RunE: func(cmd *cobra.Command, args []string) error {
return runf(cmd.Context())
},
}
return cmd.Execute()
}