@@ -41,10 +41,9 @@ import (
41
41
)
42
42
43
43
func init () {
44
- // Initialize flags for the version command
44
+ // Initialize flags for the bugreport command
45
45
// This separation keeps flag definitions isolated from command execution logic
46
- globalFlags := NewVersionFlags ()
47
- globalFlags .AddFlags (Cmd )
46
+ flags .AddClientTimeout (Cmd )
48
47
}
49
48
50
49
// GetVersionReadCloser returns a ReadCloser with the output produced by running the "nomos version" command as a string
@@ -65,34 +64,31 @@ func GetVersionReadCloser(ctx context.Context) (io.ReadCloser, error) {
65
64
return io .NopCloser (r ), nil
66
65
}
67
66
68
- var (
69
- // clientVersion is a function that obtains the local client version.
70
- clientVersion = func () string {
71
- return version .VERSION
72
- }
67
+ var clientVersion = func () string {
68
+ return version .VERSION
69
+ }
73
70
74
- // Cmd is the Cobra object representing the nomos version command.
75
- Cmd = & cobra.Command {
76
- Use : "version" ,
77
- Short : "Prints the version of ACM for each cluster as well this CLI" ,
78
- Long : `Prints the version of Configuration Management installed on each cluster and the version
71
+ // Cmd is the Cobra object representing the nomos version command.
72
+ var Cmd = & cobra.Command {
73
+ Use : "version" ,
74
+ Short : "Prints the version of ACM for each cluster as well this CLI" ,
75
+ Long : `Prints the version of Configuration Management installed on each cluster and the version
79
76
of the "nomos" client binary for debugging purposes.` ,
80
- Example : ` nomos version` ,
81
- RunE : func (cmd * cobra.Command , _ []string ) error {
82
- // Don't show usage on error, as argument validation passed.
83
- cmd .SilenceUsage = true
77
+ Example : ` nomos version` ,
78
+ RunE : func (cmd * cobra.Command , _ []string ) error {
79
+ // Don't show usage on error, as argument validation passed.
80
+ cmd .SilenceUsage = true
84
81
85
- // Create execution parameters from parsed flags
86
- params := ExecParams {
87
- Contexts : flags .Contexts ,
88
- ClientTimeout : flags .ClientTimeout ,
89
- }
82
+ // Create execution parameters from parsed flags
83
+ params := ExecParams {
84
+ Contexts : flags .Contexts ,
85
+ ClientTimeout : flags .ClientTimeout ,
86
+ }
90
87
91
- // Execute the version command logic
92
- return ExecuteVersion (cmd .Context (), params )
93
- },
94
- }
95
- )
88
+ // Execute the version command logic
89
+ return ExecuteVersion (cmd .Context (), params )
90
+ },
91
+ }
96
92
97
93
// allKubectlConfigs gets all kubectl configs, with error handling
98
94
// This function is maintained for backward compatibility with existing code
0 commit comments