mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 04:48:33 +07:00
Deprecate Settings and Options in favor of Config
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
This commit is contained in:
@@ -172,21 +172,15 @@ func example(ref *reference) error {
|
||||
ref.Usage = fmt.Sprintf("%s%s ./examples/", ref.Command, flag)
|
||||
|
||||
config := print.DefaultConfig()
|
||||
config.ModuleRoot = "./examples"
|
||||
config.Formatter = ref.Name
|
||||
config.Settings.Color = false
|
||||
options := &terraform.Options{
|
||||
Path: "./examples",
|
||||
ShowHeader: true,
|
||||
HeaderFromFile: "main.tf",
|
||||
ShowFooter: true,
|
||||
FooterFromFile: "footer.md",
|
||||
SortBy: &terraform.SortBy{
|
||||
Name: true,
|
||||
},
|
||||
ReadComments: true,
|
||||
}
|
||||
config.Sections.Show = append(config.Sections.Show, "all")
|
||||
config.Sections.Footer = true
|
||||
config.FooterFrom = "footer.md"
|
||||
config.Parse()
|
||||
|
||||
tfmodule, err := terraform.LoadWithOptions(options)
|
||||
tfmodule, err := terraform.LoadWithOptions(config)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user