Skip to content

Commit 0a5eb3b

Browse files
committed
implement version command
1 parent 9a0a47d commit 0a5eb3b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

cmd/version.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,17 @@ package cmd
2424
import (
2525
"fmt"
2626

27+
"github.com/ks6088ts/template-go/internal"
2728
"github.com/spf13/cobra"
2829
)
2930

3031
// versionCmd represents the version command
3132
var versionCmd = &cobra.Command{
3233
Use: "version",
33-
Short: "A brief description of your command",
34-
Long: `A longer description that spans multiple lines and likely contains examples
35-
and usage of using your command. For example:
36-
37-
Cobra is a CLI library for Go that empowers applications.
38-
This application is a tool to generate the needed files
39-
to quickly create a Cobra application.`,
34+
Short: "Version command",
35+
Long: `Version command is a command to show the version of the application.`,
4036
Run: func(cmd *cobra.Command, args []string) {
41-
fmt.Println("version called")
37+
fmt.Printf("version=%s, revision=%s\n", internal.Version, internal.Revision)
4238
},
4339
}
4440

0 commit comments

Comments
 (0)