8
8
"path/filepath"
9
9
"time"
10
10
11
+ "github.com/alexellis/kubetrim/pkg"
11
12
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
12
13
"k8s.io/client-go/kubernetes"
13
14
_ "k8s.io/client-go/plugin/pkg/client/auth/azure"
@@ -22,12 +23,6 @@ import (
22
23
)
23
24
24
25
var (
25
- // Version is the version of the tool
26
- Version = "dev"
27
-
28
- // GitCommit is the git commit of the tool
29
- GitCommit = ""
30
-
31
26
writeFile bool
32
27
)
33
28
@@ -36,7 +31,9 @@ func main() {
36
31
// set usage:
37
32
38
33
flag .Usage = func () {
39
- fmt .Printf ("kubetrim Copyright Alex Ellis (c) 2024\n \n " )
34
+
35
+ fmt .Printf ("kubetrim (%s %s) Copyright Alex Ellis (c) 2024\n \n " , pkg .Version , pkg .GitCommit )
36
+ fmt .Print ("Sponsor Alex on GitHub: https://github.com/sponsors/alexellis\n \n " )
40
37
fmt .Fprintf (flag .CommandLine .Output (), "Usage of %s:\n " , os .Args [0 ])
41
38
fmt .Fprintf (flag .CommandLine .Output (), "kubetrim removes contexts & clusters from your kubeconfig if they are not accessible.\n \n " )
42
39
fmt .Fprintf (flag .CommandLine .Output (), "Set the kubeconfig file to use through the KUBECONFIG environment variable\n " )
@@ -62,7 +59,7 @@ func main() {
62
59
os .Exit (1 )
63
60
}
64
61
65
- fmt .Printf ("kubetrim (%s %s) by Alex Ellis \n \n Loaded: %s. Checking..\n " , Version , GitCommit , kubeconfig )
62
+ fmt .Printf ("kubetrim (%s %s) by Alex Ellis \n \n Loaded: %s. Checking..\n " , pkg . Version , pkg . GitCommit , kubeconfig )
66
63
67
64
st := time .Now ()
68
65
// List of contexts to be deleted
0 commit comments