forked from derailed/k9s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfo.go
37 lines (31 loc) · 795 Bytes
/
info.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
package cmd
import (
"fmt"
"github.com/derailed/k9s/internal/color"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/ui"
"github.com/spf13/cobra"
)
func infoCmd() *cobra.Command {
return &cobra.Command{
Use: "info",
Short: "Print configuration info",
Long: "Print configuration information",
Run: func(cmd *cobra.Command, args []string) {
printInfo()
},
}
}
func printInfo() {
const fmat = "%-25s %s\n"
printLogo(color.Cyan)
printTuple(fmat, "Configuration", config.K9sConfigFile, color.Cyan)
printTuple(fmat, "Logs", config.K9sLogs, color.Cyan)
printTuple(fmat, "Screen Dumps", config.K9sDumpDir, color.Cyan)
}
func printLogo(c color.Paint) {
for _, l := range ui.LogoSmall {
fmt.Println(color.Colorize(l, c))
}
fmt.Println()
}