feat: add version command

Signed-off-by: cpendery <cpendery@vt.edu>
This commit is contained in:
cpendery
2023-09-14 20:33:06 -04:00
parent ae1044cd16
commit d82f77303f
+27
View File
@@ -0,0 +1,27 @@
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
var (
version string
)
func init() {
rootCmd.AddCommand(versionCmd)
}
var versionCmd = &cobra.Command{
Use: "version",
Short: "view clac's version",
Args: cobra.ExactArgs(0),
RunE: runVersionCmd,
}
func runVersionCmd(_ *cobra.Command, args []string) error {
fmt.Printf("clac version: %s", version)
return nil
}