-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmain.go
54 lines (50 loc) · 1.16 KB
/
main.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package main
import (
"os"
"github.com/trois-six/k8s-diagrams/cmd"
"github.com/rs/zerolog/log"
"github.com/urfave/cli/v2"
)
func main() {
app := &cli.App{
Name: "k8s-diagrams",
Usage: "Create diagram from the Kubernetes API.",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "namespace",
Aliases: []string{"n"},
Usage: "The namespace we want to draw.",
EnvVars: []string{"KUBECTL_NAMESPACE"},
Value: "default",
},
&cli.StringFlag{
Name: "kubeconfig",
Aliases: []string{"c"},
Usage: "The path to your kube config file.",
EnvVars: []string{"KUBECONFIG"},
},
&cli.StringFlag{
Name: "outputFilename",
Aliases: []string{"o"},
Usage: "The output filename.",
Value: "k8s",
},
&cli.StringFlag{
Name: "outputDirectory",
Aliases: []string{"d"},
Usage: "The output directory.",
Value: "diagrams",
},
&cli.StringFlag{
Name: "label",
Aliases: []string{"l"},
Usage: "The diagram label.",
Value: "Kubernetes",
},
},
Action: cmd.Run,
}
if err := app.Run(os.Args); err != nil {
log.Fatal().Err(err).Msg("Error while executing command")
}
}