Skip to content

Commit 1d4f0f0

Browse files
author
NETIZEN-11
committed
fix: Change versionCmd to use RunE instead of Run
- Update versionCmd to use RunE field for proper error handling - Return nil error from version command function - Fixes Copilot review comment about RunE compatibility Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
1 parent ea3560a commit 1d4f0f0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

run/run.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,14 @@ var versionCmd = &cobra.Command{
163163
164164
The version follows semantic versioning (semver) format: vMAJOR.MINOR.PATCH
165165
For more information, see https://semver.org`,
166-
Run: func(_ *cobra.Command, _ []string) {
166+
RunE: func(_ *cobra.Command, _ []string) error {
167167
// Display version in a clear format
168168
if version == "unknown" {
169169
fmt.Println("kpt version: unknown (development build)")
170170
} else {
171171
fmt.Printf("kpt version: %s\n", version)
172172
}
173+
return nil
173174
},
174175
}
175176

0 commit comments

Comments
 (0)