package ignitecmd

import (
	"github.com/spf13/cobra"

	"git.cw.tr/mukan-network/mukan-ignite/ignite/version"
)

// NewVersion creates a new version command to show the Ignite CLI version.
func NewVersion() *cobra.Command {
	c := &cobra.Command{
		Use:   "version",
		Short: "Print the current build information",
		RunE: func(cmd *cobra.Command, _ []string) error {
			v, err := version.Long(cmd.Context())
			if err != nil {
				return err
			}
			cmd.Println(v)
			return nil
		},
	}
	return c
}
