mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 04:48:33 +07:00
refactor: Deprecate multiple flags in favor of new ones (#265)
BREAKING CHANGE: - Following flags have been deprecated and will be removed in the following releases: - Flag `--no-color` has been deprecated, use `--color=false` instead - Flag `--no-escape` has been deprecated, use `--escape=false` instead - Flag `--no-header` has been deprecated, use `--hide header` instead - Flag `--no-inputs` has been deprecated, use `--hide inputs` instead - Flag `--no-outputs` has been deprecated, use `--hide outputs` instead - Flag `--no-providers` has been deprecated, use `--hide providers` instead - Flag `--no-requirements` has been deprecated, use `--hide requirements` instead - Flag `--no-required` has been deprecated, use `--required=false` instead - Flag `--no-sensitive` has been deprecated, use `--sensitive=false` instead - Flag `--no-sort` has been deprecated, use `--sort=false` instead
This commit is contained in:
@@ -34,6 +34,11 @@ var asciidocDocumentCmd = &cobra.Command{
|
||||
func init() {
|
||||
asciidocCmd.PersistentFlags().BoolVar(new(bool), "no-required", false, "do not show \"Required\" column or section")
|
||||
asciidocCmd.PersistentFlags().BoolVar(new(bool), "no-sensitive", false, "do not show \"Sensitive\" column or section")
|
||||
asciidocCmd.PersistentFlags().MarkDeprecated("no-required", "use '--required=false' instead") //nolint:errcheck
|
||||
asciidocCmd.PersistentFlags().MarkDeprecated("no-sensitive", "use '--sensitive=false' instead") //nolint:errcheck
|
||||
|
||||
asciidocCmd.PersistentFlags().BoolVar(&settings.ShowRequired, "required", true, "show \"Required\" column or section")
|
||||
asciidocCmd.PersistentFlags().BoolVar(&settings.ShowSensitivity, "sensitive", true, "show \"Sensitive\" column or section")
|
||||
asciidocCmd.PersistentFlags().IntVar(&settings.IndentLevel, "indent", 2, "indention level of AsciiDoc sections [1, 2, 3, 4, 5]")
|
||||
|
||||
asciidocCmd.AddCommand(asciidocTableCmd)
|
||||
|
||||
@@ -14,6 +14,9 @@ var jsonCmd = &cobra.Command{
|
||||
|
||||
func init() {
|
||||
jsonCmd.PersistentFlags().BoolVar(new(bool), "no-escape", false, "do not escape special characters")
|
||||
jsonCmd.PersistentFlags().MarkDeprecated("no-escape", "use '--escape=false' instead") //nolint:errcheck
|
||||
|
||||
jsonCmd.PersistentFlags().BoolVar(&settings.EscapeCharacters, "escape", true, "escape special characters")
|
||||
|
||||
rootCmd.AddCommand(jsonCmd)
|
||||
}
|
||||
|
||||
@@ -35,6 +35,13 @@ func init() {
|
||||
markdownCmd.PersistentFlags().BoolVar(new(bool), "no-required", false, "do not show \"Required\" column or section")
|
||||
markdownCmd.PersistentFlags().BoolVar(new(bool), "no-sensitive", false, "do not show \"Sensitive\" column or section")
|
||||
markdownCmd.PersistentFlags().BoolVar(new(bool), "no-escape", false, "do not escape special characters")
|
||||
markdownCmd.PersistentFlags().MarkDeprecated("no-required", "use '--required=false' instead") //nolint:errcheck
|
||||
markdownCmd.PersistentFlags().MarkDeprecated("no-sensitive", "use '--sensitive=false' instead") //nolint:errcheck
|
||||
markdownCmd.PersistentFlags().MarkDeprecated("no-escape", "use '--escape=false' instead") //nolint:errcheck
|
||||
|
||||
markdownCmd.PersistentFlags().BoolVar(&settings.ShowRequired, "required", true, "show \"Required\" column or section")
|
||||
markdownCmd.PersistentFlags().BoolVar(&settings.ShowSensitivity, "sensitive", true, "show \"Sensitive\" column or section")
|
||||
markdownCmd.PersistentFlags().BoolVar(&settings.EscapeCharacters, "escape", true, "escape special characters")
|
||||
markdownCmd.PersistentFlags().IntVar(&settings.IndentLevel, "indent", 2, "indention level of Markdown sections [1, 2, 3, 4, 5]")
|
||||
|
||||
markdownCmd.AddCommand(markdownTableCmd)
|
||||
|
||||
@@ -14,6 +14,9 @@ var prettyCmd = &cobra.Command{
|
||||
|
||||
func init() {
|
||||
prettyCmd.PersistentFlags().BoolVar(new(bool), "no-color", false, "do not colorize printed result")
|
||||
prettyCmd.PersistentFlags().MarkDeprecated("no-color", "use '--color=false' instead") //nolint:errcheck
|
||||
|
||||
prettyCmd.PersistentFlags().BoolVar(&settings.ShowColor, "color", true, "colorize printed result")
|
||||
|
||||
rootCmd.AddCommand(prettyCmd)
|
||||
}
|
||||
|
||||
93
cmd/root.go
93
cmd/root.go
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/segmentio/terraform-docs/pkg/print"
|
||||
)
|
||||
|
||||
var hides []string
|
||||
var settings = print.NewSettings()
|
||||
var options = module.NewOptions()
|
||||
|
||||
@@ -23,30 +24,77 @@ var rootCmd = &cobra.Command{
|
||||
Version: version.Version(),
|
||||
SilenceUsage: true,
|
||||
SilenceErrors: true,
|
||||
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
oppositeBool := func(name string) bool {
|
||||
val, _ := cmd.Flags().GetBool(name)
|
||||
return !val
|
||||
}
|
||||
settings.ShowHeader = oppositeBool("no-header")
|
||||
|
||||
for _, h := range hides {
|
||||
switch h {
|
||||
case "header":
|
||||
case "inputs":
|
||||
case "outputs":
|
||||
case "providers":
|
||||
case "requirements":
|
||||
default:
|
||||
return fmt.Errorf("'%s' is not a valid section to hide, available options [header, inputs, outputs, providers, requirements]", h)
|
||||
}
|
||||
}
|
||||
|
||||
if len(hides) > 0 && contains("header") {
|
||||
settings.ShowHeader = false
|
||||
} else {
|
||||
settings.ShowHeader = oppositeBool("no-header")
|
||||
}
|
||||
options.ShowHeader = settings.ShowHeader
|
||||
|
||||
settings.ShowInputs = oppositeBool("no-inputs")
|
||||
settings.ShowOutputs = oppositeBool("no-outputs")
|
||||
settings.ShowProviders = oppositeBool("no-providers")
|
||||
settings.ShowRequirements = oppositeBool("no-requirements")
|
||||
if len(hides) > 0 && contains("inputs") {
|
||||
settings.ShowInputs = false
|
||||
} else {
|
||||
settings.ShowInputs = oppositeBool("no-inputs")
|
||||
}
|
||||
if len(hides) > 0 && contains("outputs") {
|
||||
settings.ShowOutputs = false
|
||||
} else {
|
||||
settings.ShowOutputs = oppositeBool("no-outputs")
|
||||
}
|
||||
if len(hides) > 0 && contains("providers") {
|
||||
settings.ShowProviders = false
|
||||
} else {
|
||||
settings.ShowProviders = oppositeBool("no-providers")
|
||||
}
|
||||
if len(hides) > 0 && contains("requirements") {
|
||||
settings.ShowRequirements = false
|
||||
} else {
|
||||
settings.ShowRequirements = oppositeBool("no-requirements")
|
||||
}
|
||||
|
||||
settings.OutputValues = options.OutputValues
|
||||
|
||||
settings.ShowColor = oppositeBool("no-color")
|
||||
settings.SortByName = oppositeBool("no-sort")
|
||||
settings.ShowRequired = oppositeBool("no-required")
|
||||
settings.EscapeCharacters = oppositeBool("no-escape")
|
||||
settings.ShowSensitivity = oppositeBool("no-sensitive")
|
||||
if !cmd.Flags().Changed("color") {
|
||||
settings.ShowColor = oppositeBool("no-color")
|
||||
}
|
||||
if !cmd.Flags().Changed("sort") {
|
||||
settings.SortByName = oppositeBool("no-sort")
|
||||
}
|
||||
if !cmd.Flags().Changed("required") {
|
||||
settings.ShowRequired = oppositeBool("no-required")
|
||||
}
|
||||
if !cmd.Flags().Changed("escape") {
|
||||
settings.EscapeCharacters = oppositeBool("no-escape")
|
||||
}
|
||||
if !cmd.Flags().Changed("sensitive") {
|
||||
settings.ShowSensitivity = oppositeBool("no-sensitive")
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.PersistentFlags().StringSliceVar(&hides, "hide", []string{}, "hide section [header, inputs, outputs, providers, requirements]")
|
||||
|
||||
rootCmd.PersistentFlags().BoolVar(new(bool), "no-header", false, "do not show module header")
|
||||
rootCmd.PersistentFlags().BoolVar(new(bool), "no-inputs", false, "do not show inputs")
|
||||
rootCmd.PersistentFlags().BoolVar(new(bool), "no-outputs", false, "do not show outputs")
|
||||
@@ -54,13 +102,21 @@ func init() {
|
||||
rootCmd.PersistentFlags().BoolVar(new(bool), "no-requirements", false, "do not show module requirements")
|
||||
|
||||
rootCmd.PersistentFlags().BoolVar(new(bool), "no-sort", false, "do no sort items")
|
||||
rootCmd.PersistentFlags().BoolVar(&settings.SortByRequired, "sort-by-required", false, "sort items by name and print required ones first")
|
||||
rootCmd.PersistentFlags().BoolVar(&settings.SortByType, "sort-by-type", false, "sort items by type of them")
|
||||
rootCmd.PersistentFlags().BoolVar(&settings.SortByName, "sort", true, "sort items")
|
||||
rootCmd.PersistentFlags().BoolVar(&settings.SortByRequired, "sort-by-required", false, "sort items by name and print required ones first (default false)")
|
||||
rootCmd.PersistentFlags().BoolVar(&settings.SortByType, "sort-by-type", false, "sort items by type of them (default false)")
|
||||
|
||||
rootCmd.PersistentFlags().StringVar(&options.HeaderFromFile, "header-from", "main.tf", "relative path of a file to read header from")
|
||||
|
||||
rootCmd.PersistentFlags().BoolVar(&options.OutputValues, "output-values", false, "inject output values into outputs")
|
||||
rootCmd.PersistentFlags().BoolVar(&options.OutputValues, "output-values", false, "inject output values into outputs (default false)")
|
||||
rootCmd.PersistentFlags().StringVar(&options.OutputValuesPath, "output-values-from", "", "inject output values from file into outputs")
|
||||
|
||||
rootCmd.PersistentFlags().MarkDeprecated("no-header", "use '--hide header' instead") //nolint:errcheck
|
||||
rootCmd.PersistentFlags().MarkDeprecated("no-inputs", "use '--hide inputs' instead") //nolint:errcheck
|
||||
rootCmd.PersistentFlags().MarkDeprecated("no-outputs", "use '--hide outputs' instead") //nolint:errcheck
|
||||
rootCmd.PersistentFlags().MarkDeprecated("no-providers", "use '--hide providers' instead") //nolint:errcheck
|
||||
rootCmd.PersistentFlags().MarkDeprecated("no-requirements", "use '--hide requirements' instead") //nolint:errcheck
|
||||
rootCmd.PersistentFlags().MarkDeprecated("no-sort", "use '--sort=false' instead") //nolint:errcheck
|
||||
}
|
||||
|
||||
// Execute adds all child commands to the root command and sets flags appropriately.
|
||||
@@ -77,6 +133,15 @@ func RootCmd() *cobra.Command {
|
||||
return rootCmd
|
||||
}
|
||||
|
||||
func contains(section string) bool {
|
||||
for _, h := range hides {
|
||||
if h == section {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var formatRunE = func(cmd *cobra.Command, args []string) error {
|
||||
name := strings.Replace(cmd.CommandPath(), "terraform-docs ", "", -1)
|
||||
printer, err := format.Factory(name, settings)
|
||||
|
||||
@@ -11,16 +11,12 @@ A utility to generate documentation from Terraform modules in various output for
|
||||
```
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
-h, --help help for terraform-docs
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-requirements do not show module requirements
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
@@ -40,4 +36,4 @@ A utility to generate documentation from Terraform modules in various output for
|
||||
* [terraform-docs xml](/docs/formats/xml.md) - Generate XML of inputs and outputs
|
||||
* [terraform-docs yaml](/docs/formats/yaml.md) - Generate YAML of inputs and outputs
|
||||
|
||||
###### Auto generated by spf13/cobra on 13-Apr-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
@@ -20,19 +20,15 @@ terraform-docs asciidoc document [PATH] [flags]
|
||||
|
||||
```
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--indent int indention level of AsciiDoc sections [1, 2, 3, 4, 5] (default 2)
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-required do not show "Required" column or section
|
||||
--no-requirements do not show module requirements
|
||||
--no-sensitive do not show "Sensitive" column or section
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--required show "Required" column or section (default true)
|
||||
--sensitive show "Sensitive" column or section (default true)
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### Example
|
||||
@@ -420,4 +416,4 @@ generates the following output:
|
||||
|
||||
|
||||
|
||||
###### Auto generated by spf13/cobra on 13-Apr-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
@@ -20,19 +20,15 @@ terraform-docs asciidoc table [PATH] [flags]
|
||||
|
||||
```
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--indent int indention level of AsciiDoc sections [1, 2, 3, 4, 5] (default 2)
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-required do not show "Required" column or section
|
||||
--no-requirements do not show module requirements
|
||||
--no-sensitive do not show "Sensitive" column or section
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--required show "Required" column or section (default true)
|
||||
--sensitive show "Sensitive" column or section (default true)
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### Example
|
||||
@@ -376,4 +372,4 @@ generates the following output:
|
||||
|
||||
|
||||
|
||||
###### Auto generated by spf13/cobra on 13-Apr-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
@@ -13,26 +13,22 @@ terraform-docs asciidoc [PATH] [flags]
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for asciidoc
|
||||
--indent int indention level of AsciiDoc sections [1, 2, 3, 4, 5] (default 2)
|
||||
--no-required do not show "Required" column or section
|
||||
--no-sensitive do not show "Sensitive" column or section
|
||||
-h, --help help for asciidoc
|
||||
--indent int indention level of AsciiDoc sections [1, 2, 3, 4, 5] (default 2)
|
||||
--required show "Required" column or section (default true)
|
||||
--sensitive show "Sensitive" column or section (default true)
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-requirements do not show module requirements
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
@@ -40,4 +36,4 @@ terraform-docs asciidoc [PATH] [flags]
|
||||
* [terraform-docs asciidoc document](/docs/formats/asciidoc-document.md) - Generate AsciiDoc document of inputs and outputs
|
||||
* [terraform-docs asciidoc table](/docs/formats/asciidoc-table.md) - Generate AsciiDoc tables of inputs and outputs
|
||||
|
||||
###### Auto generated by spf13/cobra on 13-Apr-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
@@ -13,24 +13,20 @@ terraform-docs json [PATH] [flags]
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for json
|
||||
--no-escape do not escape special characters
|
||||
--escape escape special characters (default true)
|
||||
-h, --help help for json
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-requirements do not show module requirements
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### Example
|
||||
@@ -339,4 +335,4 @@ generates the following output:
|
||||
}
|
||||
|
||||
|
||||
###### Auto generated by spf13/cobra on 13-Apr-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
@@ -19,21 +19,17 @@ terraform-docs markdown document [PATH] [flags]
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--escape escape special characters (default true)
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--indent int indention level of Markdown sections [1, 2, 3, 4, 5] (default 2)
|
||||
--no-escape do not escape special characters
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-required do not show "Required" column or section
|
||||
--no-requirements do not show module requirements
|
||||
--no-sensitive do not show "Sensitive" column or section
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--required show "Required" column or section (default true)
|
||||
--sensitive show "Sensitive" column or section (default true)
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### Example
|
||||
@@ -421,4 +417,4 @@ generates the following output:
|
||||
|
||||
|
||||
|
||||
###### Auto generated by spf13/cobra on 13-Apr-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
@@ -19,21 +19,17 @@ terraform-docs markdown table [PATH] [flags]
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--escape escape special characters (default true)
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--indent int indention level of Markdown sections [1, 2, 3, 4, 5] (default 2)
|
||||
--no-escape do not escape special characters
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-required do not show "Required" column or section
|
||||
--no-requirements do not show module requirements
|
||||
--no-sensitive do not show "Sensitive" column or section
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--required show "Required" column or section (default true)
|
||||
--sensitive show "Sensitive" column or section (default true)
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### Example
|
||||
@@ -147,4 +143,4 @@ generates the following output:
|
||||
|
||||
|
||||
|
||||
###### Auto generated by spf13/cobra on 13-Apr-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
@@ -13,27 +13,23 @@ terraform-docs markdown [PATH] [flags]
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for markdown
|
||||
--indent int indention level of Markdown sections [1, 2, 3, 4, 5] (default 2)
|
||||
--no-escape do not escape special characters
|
||||
--no-required do not show "Required" column or section
|
||||
--no-sensitive do not show "Sensitive" column or section
|
||||
--escape escape special characters (default true)
|
||||
-h, --help help for markdown
|
||||
--indent int indention level of Markdown sections [1, 2, 3, 4, 5] (default 2)
|
||||
--required show "Required" column or section (default true)
|
||||
--sensitive show "Sensitive" column or section (default true)
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-requirements do not show module requirements
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
@@ -41,4 +37,4 @@ terraform-docs markdown [PATH] [flags]
|
||||
* [terraform-docs markdown document](/docs/formats/markdown-document.md) - Generate Markdown document of inputs and outputs
|
||||
* [terraform-docs markdown table](/docs/formats/markdown-table.md) - Generate Markdown tables of inputs and outputs
|
||||
|
||||
###### Auto generated by spf13/cobra on 13-Apr-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
@@ -13,24 +13,20 @@ terraform-docs pretty [PATH] [flags]
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for pretty
|
||||
--no-color do not colorize printed result
|
||||
--color colorize printed result (default true)
|
||||
-h, --help help for pretty
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-requirements do not show module requirements
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### Example
|
||||
@@ -243,4 +239,4 @@ generates the following output:
|
||||
|
||||
|
||||
|
||||
###### Auto generated by spf13/cobra on 13-Apr-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
@@ -20,16 +20,12 @@ terraform-docs tfvars hcl [PATH] [flags]
|
||||
|
||||
```
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-requirements do not show module requirements
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### Example
|
||||
@@ -99,4 +95,4 @@ generates the following output:
|
||||
with-url = ""
|
||||
|
||||
|
||||
###### Auto generated by spf13/cobra on 13-Apr-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
@@ -20,16 +20,12 @@ terraform-docs tfvars json [PATH] [flags]
|
||||
|
||||
```
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-requirements do not show module requirements
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### Example
|
||||
@@ -101,4 +97,4 @@ generates the following output:
|
||||
}
|
||||
|
||||
|
||||
###### Auto generated by spf13/cobra on 13-Apr-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
@@ -16,16 +16,12 @@ Generate terraform.tfvars of inputs
|
||||
|
||||
```
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-requirements do not show module requirements
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
@@ -33,4 +29,4 @@ Generate terraform.tfvars of inputs
|
||||
* [terraform-docs tfvars hcl](/docs/formats/tfvars-hcl.md) - Generate HCL format of terraform.tfvars of inputs
|
||||
* [terraform-docs tfvars json](/docs/formats/tfvars-json.md) - Generate JSON format of terraform.tfvars of inputs
|
||||
|
||||
###### Auto generated by spf13/cobra on 13-Apr-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
@@ -20,16 +20,12 @@ terraform-docs toml [PATH] [flags]
|
||||
|
||||
```
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-requirements do not show module requirements
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### Example
|
||||
@@ -316,4 +312,4 @@ generates the following output:
|
||||
|
||||
|
||||
|
||||
###### Auto generated by spf13/cobra on 14-May-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
@@ -20,16 +20,12 @@ terraform-docs xml [PATH] [flags]
|
||||
|
||||
```
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-requirements do not show module requirements
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### Example
|
||||
@@ -338,4 +334,4 @@ generates the following output:
|
||||
</module>
|
||||
|
||||
|
||||
###### Auto generated by spf13/cobra on 13-Apr-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
@@ -20,16 +20,12 @@ terraform-docs yaml [PATH] [flags]
|
||||
|
||||
```
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--no-header do not show module header
|
||||
--no-inputs do not show inputs
|
||||
--no-outputs do not show outputs
|
||||
--no-providers do not show providers
|
||||
--no-requirements do not show module requirements
|
||||
--no-sort do no sort items
|
||||
--output-values inject output values into outputs
|
||||
--hide strings hide section [header, inputs, outputs, providers, requirements]
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs
|
||||
--sort-by-required sort items by name and print required ones first
|
||||
--sort-by-type sort items by type of them
|
||||
--sort sort items (default true)
|
||||
--sort-by-required sort items by name and print required ones first (default false)
|
||||
--sort-by-type sort items by type of them (default false)
|
||||
```
|
||||
|
||||
### Example
|
||||
@@ -290,4 +286,4 @@ generates the following output:
|
||||
version: '>= 2.2.0'
|
||||
|
||||
|
||||
###### Auto generated by spf13/cobra on 13-May-2020
|
||||
###### Auto generated by spf13/cobra on 19-May-2020
|
||||
|
||||
Reference in New Issue
Block a user