@@ -28,6 +28,7 @@ import (
2828 "github.com/terraform-docs/terraform-docs/cmd/yaml"
2929 "github.com/terraform-docs/terraform-docs/internal/cli"
3030 "github.com/terraform-docs/terraform-docs/internal/version"
31+ "github.com/terraform-docs/terraform-docs/print"
3132)
3233
3334// Execute adds all child commands to the root command and sets flags appropriately.
@@ -42,7 +43,7 @@ func Execute() error {
4243
4344// NewCommand returns a new cobra.Command for 'root' command
4445func NewCommand () * cobra.Command {
45- config := cli .DefaultConfig ()
46+ config := print .DefaultConfig ()
4647 runtime := cli .NewRuntime (config )
4748 cmd := & cobra.Command {
4849 Args : cobra .MaximumNArgs (1 ),
@@ -62,16 +63,16 @@ func NewCommand() *cobra.Command {
6263 cmd .PersistentFlags ().BoolVar (& config .Recursive , "recursive" , false , "update submodules recursively (default false)" )
6364 cmd .PersistentFlags ().StringVar (& config .RecursivePath , "recursive-path" , "modules" , "submodules path to recursively update" )
6465
65- cmd .PersistentFlags ().StringSliceVar (& config .Sections .Show , "show" , []string {}, "show section [" + cli .AllSections + "]" )
66- cmd .PersistentFlags ().StringSliceVar (& config .Sections .Hide , "hide" , []string {}, "hide section [" + cli .AllSections + "]" )
66+ cmd .PersistentFlags ().StringSliceVar (& config .Sections .Show , "show" , []string {}, "show section [" + print .AllSections + "]" )
67+ cmd .PersistentFlags ().StringSliceVar (& config .Sections .Hide , "hide" , []string {}, "hide section [" + print .AllSections + "]" )
6768
6869 cmd .PersistentFlags ().StringVar (& config .Output .File , "output-file" , "" , "file path to insert output into (default \" \" )" )
69- cmd .PersistentFlags ().StringVar (& config .Output .Mode , "output-mode" , "inject" , "output to file method [" + cli .OutputModes + "]" )
70- cmd .PersistentFlags ().StringVar (& config .Output .Template , "output-template" , cli .OutputTemplate , "output template" )
70+ cmd .PersistentFlags ().StringVar (& config .Output .Mode , "output-mode" , "inject" , "output to file method [" + print .OutputModes + "]" )
71+ cmd .PersistentFlags ().StringVar (& config .Output .Template , "output-template" , print .OutputTemplate , "output template" )
7172 cmd .PersistentFlags ().BoolVar (& config .Output .Check , "output-check" , false , "check if content of output file is up to date (default false)" )
7273
7374 cmd .PersistentFlags ().BoolVar (& config .Sort .Enabled , "sort" , true , "sort items" )
74- cmd .PersistentFlags ().StringVar (& config .Sort .By , "sort-by" , "name" , "sort items by criteria [" + cli .SortTypes + "]" )
75+ cmd .PersistentFlags ().StringVar (& config .Sort .By , "sort-by" , "name" , "sort items by criteria [" + print .SortTypes + "]" )
7576
7677 cmd .PersistentFlags ().StringVar (& config .HeaderFrom , "header-from" , "main.tf" , "relative path of a file to read header from" )
7778 cmd .PersistentFlags ().StringVar (& config .FooterFrom , "footer-from" , "" , "relative path of a file to read footer from (default \" \" )" )
0 commit comments