Files
gotgt/cmd/version.go
Lei Xue 2e5cea1bd0 add version
Signed-off-by: Lei Xue <vfs@live.com>
2020-07-14 22:04:20 +08:00

21 lines
446 B
Go

package cmd
import (
"github.com/spf13/cobra"
"github.com/gostor/gotgt/pkg/api/client"
"github.com/gostor/gotgt/pkg/version"
)
func newVersionCommand(cli *client.Client) *cobra.Command {
var cmd = &cobra.Command{
Use: "version",
Short: "Print the version number of gotgt",
Long: `All software has versions. This is Gotgt 's`,
Run: func(cmd *cobra.Command, args []string) {
version.PrintVersionAndExit()
},
}
return cmd
}