mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 04:48:33 +07:00
feat: Add support for tfvars hcl and json commands (#226)
* Add support for tfvars hcl and json commands * fix docs generation header issue * align padding of hcl tfvars items * add more tests * update docs * wording
This commit is contained in:
@@ -131,6 +131,10 @@ func getPrinter(name string, settings *print.Settings) print.Format {
|
||||
return format.NewTable(settings)
|
||||
case "pretty":
|
||||
return format.NewPretty(settings)
|
||||
case "tfvars hcl":
|
||||
return format.NewTfvarsHCL(settings)
|
||||
case "tfvars json":
|
||||
return format.NewTfvarsJSON(settings)
|
||||
case "xml":
|
||||
return format.NewXML(settings)
|
||||
case "yaml":
|
||||
@@ -159,6 +163,7 @@ func printExample(buf *bytes.Buffer, name string) error {
|
||||
settings.ShowColor = false
|
||||
options := &module.Options{
|
||||
Path: "./examples",
|
||||
ShowHeader: true,
|
||||
HeaderFromFile: "main.tf",
|
||||
SortBy: &module.SortBy{
|
||||
Name: settings.SortByName,
|
||||
|
||||
Reference in New Issue
Block a user