Files
terraform-docs/cmd/pretty.go
Khosrow Moossavi 23c50e0ad8 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
2020-05-20 11:49:25 -04:00

23 lines
640 B
Go

package cmd
import (
"github.com/spf13/cobra"
)
var prettyCmd = &cobra.Command{
Args: cobra.ExactArgs(1),
Use: "pretty [PATH]",
Short: "Generate colorized pretty of inputs and outputs",
Annotations: formatAnnotations("pretty"),
RunE: formatRunE,
}
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)
}