Files
terraform-docs/cmd/version.go
2020-05-19 18:18:15 -04:00

23 lines
422 B
Go

package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/segmentio/terraform-docs/internal/version"
)
var versionCmd = &cobra.Command{
Args: cobra.NoArgs,
Use: "version",
Short: "Print the version number of terraform-docs",
Run: func(cmd *cobra.Command, args []string) {
fmt.Print(fmt.Sprintf("terraform-docs version %s\n", version.Version()))
},
}
func init() {
rootCmd.AddCommand(versionCmd)
}