Files
terraform-docs/cmd/tfvars/tfvars.go
Khosrow Moossavi 04a9ef49eb refactor: Refactor cli implemention and configuration (#266)
* Refactor cli implemention and configuration

* cleanup
2020-05-20 22:21:19 -04:00

26 lines
637 B
Go

package tfvars
import (
"github.com/spf13/cobra"
"github.com/segmentio/terraform-docs/cmd/tfvars/hcl"
"github.com/segmentio/terraform-docs/cmd/tfvars/json"
"github.com/segmentio/terraform-docs/internal/cli"
)
// NewCommand returns a new cobra.Command for 'tfvars' formatter
func NewCommand(config *cli.Config) *cobra.Command {
cmd := &cobra.Command{
Args: cobra.ExactArgs(1),
Use: "tfvars [PATH]",
Short: "Generate terraform.tfvars of inputs",
Annotations: cli.Annotations("tfvars"),
}
// subcommands
cmd.AddCommand(hcl.NewCommand(config))
cmd.AddCommand(json.NewCommand(config))
return cmd
}