-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Correct displaying deprecated flag warnings (#3880)
* fix: correct displaying deprecated flag warns * chore: code improvements * chore: code comment * chore: get rid of similar warnings * chore: code improvements * fix: addressed to PR review.
- Loading branch information
1 parent
6bf5e1c
commit c49ea4f
Showing
23 changed files
with
517 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,101 @@ | ||
// Package commands represents CLI commands. | ||
package commands | ||
|
||
import ( | ||
"github.com/gruntwork-io/terragrunt/cli/commands/info" | ||
"github.com/gruntwork-io/terragrunt/cli/commands/stack" | ||
"github.com/gruntwork-io/terragrunt/options" | ||
|
||
"github.com/gruntwork-io/terragrunt/cli/commands/graph" | ||
"github.com/gruntwork-io/terragrunt/cli/commands/hclvalidate" | ||
helpCmd "github.com/gruntwork-io/terragrunt/cli/commands/help" | ||
versionCmd "github.com/gruntwork-io/terragrunt/cli/commands/version" | ||
|
||
"github.com/gruntwork-io/terragrunt/cli/commands/scaffold" | ||
|
||
awsproviderpatch "github.com/gruntwork-io/terragrunt/cli/commands/aws-provider-patch" | ||
"github.com/gruntwork-io/terragrunt/cli/commands/catalog" | ||
execCmd "github.com/gruntwork-io/terragrunt/cli/commands/exec" | ||
graphdependencies "github.com/gruntwork-io/terragrunt/cli/commands/graph-dependencies" | ||
"github.com/gruntwork-io/terragrunt/cli/commands/hclfmt" | ||
outputmodulegroups "github.com/gruntwork-io/terragrunt/cli/commands/output-module-groups" | ||
renderjson "github.com/gruntwork-io/terragrunt/cli/commands/render-json" | ||
runCmd "github.com/gruntwork-io/terragrunt/cli/commands/run" | ||
runall "github.com/gruntwork-io/terragrunt/cli/commands/run-all" | ||
terragruntinfo "github.com/gruntwork-io/terragrunt/cli/commands/terragrunt-info" | ||
validateinputs "github.com/gruntwork-io/terragrunt/cli/commands/validate-inputs" | ||
"github.com/gruntwork-io/terragrunt/internal/cli" | ||
) | ||
|
||
// Command category names. | ||
const ( | ||
// MainCommandsCategoryName represents primary Terragrunt operations like run, run-all. | ||
MainCommandsCategoryName = "Main commands" | ||
// CatalogCommandsCategoryName represents commands for managing Terragrunt catalogs. | ||
CatalogCommandsCategoryName = "Catalog commands" | ||
// ConfigurationCommandsCategoryName represents commands for managing Terragrunt configurations. | ||
ConfigurationCommandsCategoryName = "Configuration commands" | ||
// ShortcutsCommandsCategoryName represents OpenTofu-specific shortcut commands. | ||
ShortcutsCommandsCategoryName = "OpenTofu shortcuts" | ||
) | ||
|
||
// New returns the set of Terragrunt commands, grouped into categories. | ||
// Categories are ordered in increments of 10 for easy insertion of new categories. | ||
func New(opts *options.TerragruntOptions) cli.Commands { | ||
mainCommands := cli.Commands{ | ||
runCmd.NewCommand(opts), // run | ||
runall.NewCommand(opts), // run-all | ||
stack.NewCommand(opts), // stack | ||
graph.NewCommand(opts), // graph | ||
execCmd.NewCommand(opts), // exec | ||
}.SetCategory( | ||
&cli.Category{ | ||
Name: MainCommandsCategoryName, | ||
Order: 10, //nolint: mnd | ||
}, | ||
) | ||
|
||
catalogCommands := cli.Commands{ | ||
catalog.NewCommand(opts), // catalog | ||
scaffold.NewCommand(opts), // scaffold | ||
}.SetCategory( | ||
&cli.Category{ | ||
Name: CatalogCommandsCategoryName, | ||
Order: 20, //nolint: mnd | ||
}, | ||
) | ||
|
||
configurationCommands := cli.Commands{ | ||
graphdependencies.NewCommand(opts), // graph-dependencies | ||
outputmodulegroups.NewCommand(opts), // output-module-groups | ||
validateinputs.NewCommand(opts), // validate-inputs | ||
hclvalidate.NewCommand(opts), // hclvalidate | ||
hclfmt.NewCommand(opts), // hclfmt | ||
info.NewCommand(opts), // info | ||
terragruntinfo.NewCommand(opts), // terragrunt-info | ||
renderjson.NewCommand(opts), // render-json | ||
helpCmd.NewCommand(opts), // help (hidden) | ||
versionCmd.NewCommand(opts), // version (hidden) | ||
awsproviderpatch.NewCommand(opts), // aws-provider-patch (hidden) | ||
}.SetCategory( | ||
&cli.Category{ | ||
Name: ConfigurationCommandsCategoryName, | ||
Order: 30, //nolint: mnd | ||
}, | ||
) | ||
|
||
shortcutsCommands := NewShortcutsCommands(opts).SetCategory( | ||
&cli.Category{ | ||
Name: ShortcutsCommandsCategoryName, | ||
Order: 40, //nolint: mnd | ||
}, | ||
) | ||
|
||
allCommands := mainCommands. | ||
Merge(catalogCommands...). | ||
Merge(configurationCommands...). | ||
Merge(shortcutsCommands...). | ||
Merge(NewDeprecatedCommands(opts)...) | ||
|
||
return allCommands | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.