forked from chmouel/tkn-autogenerate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tknautogenerate.go
40 lines (32 loc) · 976 Bytes
/
tknautogenerate.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// -*- mode:go;mode:go-playground -*-
// snippet of code @ 2023-07-06 09:37:17
// === Go Playground ===
// Execute the snippet with: Ctl-Return
// Provide custom arguments to compile with: Alt-Return
// Other useful commands:
// - remove the snippet completely with its dir and all files: (go-playground-rm)
// - upload the current buffer to playground.golang.org: (go-playground-upload)
package main
import (
"fmt"
"strings"
_ "embed"
"github.com/alecthomas/kong"
ag "github.com/chmouel/tknautogenerate/pkg/tknautogenerate"
)
var CLI ag.CliStruct
func main() {
kong.Parse(&CLI,
kong.Name("tkn-autogenerate"),
kong.Description("🧲 Auto generation of pipelinerun on language detection and file patterns"),
kong.UsageOnError(),
kong.ConfigureHelp(kong.HelpOptions{
Compact: true,
Summary: true,
}))
output, err := ag.Detect(&CLI)
if err != nil {
fmt.Printf("Error: %v", err)
}
fmt.Println(strings.TrimSpace(output))
}