mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 12:58:35 +07:00
* Migrate to github.com/terraform-docs org * remove codecov token * update maintenance notice in README
28 lines
564 B
Go
28 lines
564 B
Go
package version
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/terraform-docs/terraform-docs/internal/version"
|
|
)
|
|
|
|
// NewCommand returns a new cobra.Command for 'version' command
|
|
func NewCommand() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Args: cobra.NoArgs,
|
|
Use: "version",
|
|
Short: "Print the version number of terraform-docs",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
fmt.Printf("terraform-docs version %s\n", Full())
|
|
},
|
|
}
|
|
return cmd
|
|
}
|
|
|
|
// Full returns the full version of the binary
|
|
func Full() string {
|
|
return version.Full()
|
|
}
|