mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-29 12:48:18 +00:00
25 lines
469 B
Go
25 lines
469 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
// VersionCmd prints the current version.
|
|
type VersionCmd struct {
|
|
Viper *viper.Viper
|
|
}
|
|
|
|
// Init returns the runnable cobra command.
|
|
func (v *VersionCmd) Init() *cobra.Command {
|
|
return &cobra.Command{
|
|
Use: "version",
|
|
Short: "Print the current Atlantis version",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
fmt.Printf("atlantis %s\n", v.Viper.Get("version"))
|
|
},
|
|
}
|
|
}
|