mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 12:58:35 +07:00
* Introduce format interface and expose to public pkg * fix issues after merge * don't panic * Rename TFString back to String
22 lines
421 B
Go
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)
|
|
}
|