oh-my-posh/src/cli/version.go

23 lines
411 B
Go
Raw Normal View History

package cli
2022-03-12 13:04:08 -08:00
import (
"fmt"
"github.com/spf13/cobra"
)
// versionCmd represents the version command
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version",
Long: "Print the version number of oh-my-posh.",
Args: cobra.NoArgs,
2022-03-12 13:04:08 -08:00
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(cliVersion)
2022-03-12 13:04:08 -08:00
},
}
func init() { //nolint:gochecknoinits
2022-03-12 13:04:08 -08:00
rootCmd.AddCommand(versionCmd)
}