Files
terraform-docs/cmd/version.go
Khosrow Moossavi 38e18970ed refactor: Introduce Format interface and expose to public pkg (#195)
* Introduce format interface and expose to public pkg

* fix issues after merge

* don't panic

* Rename TFString back to String
2020-02-19 14:07:10 -05:00

22 lines
421 B
Go

package cmd
import (
"fmt"
"github.com/segmentio/terraform-docs/internal/version"
"github.com/spf13/cobra"
)
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)
}