Completely remove deprecated '--no-XXX' flags

In v0.10.0 flags '--no-XXX' have been deprecated in favor of their
counterparts in the format of '--X=false' (e.g. --no-header and
--header=false). And they are completely being removed now (two releases
after original announcement)

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
This commit is contained in:
Khosrow Moossavi
2021-02-23 18:46:02 -05:00
parent a91c3dbebb
commit 25d2ff4e53
6 changed files with 12 additions and 120 deletions

View File

@@ -35,12 +35,6 @@ func NewCommand(config *cli.Config) *cobra.Command {
cmd.PersistentFlags().BoolVar(&config.Settings.Sensitive, "sensitive", true, "show Sensitive column or section")
cmd.PersistentFlags().IntVar(&config.Settings.Indent, "indent", 2, "indention level of AsciiDoc sections [1, 2, 3, 4, 5]")
// deprecation
cmd.PersistentFlags().BoolVar(&config.Settings.Deprecated.NoRequired, "no-required", false, "do not show \"Required\" column or section")
cmd.PersistentFlags().BoolVar(&config.Settings.Deprecated.NoSensitive, "no-sensitive", false, "do not show \"Sensitive\" column or section")
cmd.PersistentFlags().MarkDeprecated("no-required", "use '--required=false' instead") //nolint:errcheck
cmd.PersistentFlags().MarkDeprecated("no-sensitive", "use '--sensitive=false' instead") //nolint:errcheck
// subcommands
cmd.AddCommand(document.NewCommand(config))
cmd.AddCommand(table.NewCommand(config))

View File

@@ -30,9 +30,5 @@ func NewCommand(config *cli.Config) *cobra.Command {
// flags
cmd.PersistentFlags().BoolVar(&config.Settings.Escape, "escape", true, "escape special characters")
// deprecation
cmd.PersistentFlags().BoolVar(&config.Settings.Deprecated.NoEscape, "no-escape", false, "do not escape special characters")
cmd.PersistentFlags().MarkDeprecated("no-escape", "use '--escape=false' instead") //nolint:errcheck
return cmd
}

View File

@@ -36,14 +36,6 @@ func NewCommand(config *cli.Config) *cobra.Command {
cmd.PersistentFlags().BoolVar(&config.Settings.Escape, "escape", true, "escape special characters")
cmd.PersistentFlags().IntVar(&config.Settings.Indent, "indent", 2, "indention level of Markdown sections [1, 2, 3, 4, 5]")
// deprecation
cmd.PersistentFlags().BoolVar(&config.Settings.Deprecated.NoRequired, "no-required", false, "do not show \"Required\" column or section")
cmd.PersistentFlags().BoolVar(&config.Settings.Deprecated.NoSensitive, "no-sensitive", false, "do not show \"Sensitive\" column or section")
cmd.PersistentFlags().BoolVar(&config.Settings.Deprecated.NoEscape, "no-escape", false, "do not escape special characters")
cmd.PersistentFlags().MarkDeprecated("no-required", "use '--required=false' instead") //nolint:errcheck
cmd.PersistentFlags().MarkDeprecated("no-sensitive", "use '--sensitive=false' instead") //nolint:errcheck
cmd.PersistentFlags().MarkDeprecated("no-escape", "use '--escape=false' instead") //nolint:errcheck
// subcommands
cmd.AddCommand(document.NewCommand(config))
cmd.AddCommand(table.NewCommand(config))

View File

@@ -30,9 +30,5 @@ func NewCommand(config *cli.Config) *cobra.Command {
// flags
cmd.PersistentFlags().BoolVar(&config.Settings.Color, "color", true, "colorize printed result")
// deprecation
cmd.PersistentFlags().BoolVar(&config.Settings.Deprecated.NoColor, "no-color", false, "do not colorize printed result")
cmd.PersistentFlags().MarkDeprecated("no-color", "use '--color=false' instead") //nolint:errcheck
return cmd
}

View File

@@ -71,21 +71,6 @@ func NewCommand() *cobra.Command {
cmd.PersistentFlags().BoolVar(&config.OutputValues.Enabled, "output-values", false, "inject output values into outputs (default false)")
cmd.PersistentFlags().StringVar(&config.OutputValues.From, "output-values-from", "", "inject output values from file into outputs (default \"\")")
// deprecation
cmd.PersistentFlags().BoolVar(&config.Sections.Deprecated.NoHeader, "no-header", false, "do not show module header")
cmd.PersistentFlags().BoolVar(&config.Sections.Deprecated.NoInputs, "no-inputs", false, "do not show inputs")
cmd.PersistentFlags().BoolVar(&config.Sections.Deprecated.NoOutputs, "no-outputs", false, "do not show outputs")
cmd.PersistentFlags().BoolVar(&config.Sections.Deprecated.NoProviders, "no-providers", false, "do not show providers")
cmd.PersistentFlags().BoolVar(&config.Sections.Deprecated.NoRequirements, "no-requirements", false, "do not show module requirements")
cmd.PersistentFlags().BoolVar(&config.Sort.Deprecated.NoSort, "no-sort", false, "do no sort items")
cmd.PersistentFlags().MarkDeprecated("no-header", "use '--hide header' instead") //nolint:errcheck
cmd.PersistentFlags().MarkDeprecated("no-inputs", "use '--hide inputs' instead") //nolint:errcheck
cmd.PersistentFlags().MarkDeprecated("no-outputs", "use '--hide outputs' instead") //nolint:errcheck
cmd.PersistentFlags().MarkDeprecated("no-providers", "use '--hide providers' instead") //nolint:errcheck
cmd.PersistentFlags().MarkDeprecated("no-requirements", "use '--hide requirements' instead") //nolint:errcheck
cmd.PersistentFlags().MarkDeprecated("no-sort", "use '--sort=false' instead") //nolint:errcheck
// formatter subcommands
cmd.AddCommand(asciidoc.NewCommand(config))
cmd.AddCommand(json.NewCommand(config))