diff --git a/commands.go b/commands.go index 683e07e66d..1237bfe49a 100644 --- a/commands.go +++ b/commands.go @@ -276,17 +276,6 @@ func initCommands( }, nil }, - // "rpcapi" is handled a bit differently because the whole point of - // this interface is to bypass the CLI layer so wrapping automation can - // get as-direct-as-possible access to Terraform Core functionality, - // without interference from behaviors that are intended for CLI - // end-user convenience. We bypass the "command" package entirely - // for this command in particular. - "rpcapi": rpcapi.CLICommandFactory(rpcapi.CommandFactoryOpts{ - ExperimentsAllowed: meta.AllowExperimentalFeatures, - ShutdownCh: meta.ShutdownCh, - }), - "show": func() (cli.Command, error) { return &command.ShowCommand{ Meta: meta, @@ -432,6 +421,17 @@ func initCommands( Meta: meta, }, nil } + + // "rpcapi" is handled a bit differently because the whole point of + // this interface is to bypass the CLI layer so wrapping automation can + // get as-direct-as-possible access to Terraform Core functionality, + // without interference from behaviors that are intended for CLI + // end-user convenience. We bypass the "command" package entirely + // for this command in particular. + Commands["rpcapi"] = rpcapi.CLICommandFactory(rpcapi.CommandFactoryOpts{ + ExperimentsAllowed: meta.AllowExperimentalFeatures, + ShutdownCh: meta.ShutdownCh, + }) } PrimaryCommands = []string{ @@ -443,10 +443,10 @@ func initCommands( } HiddenCommands = map[string]struct{}{ - "env": struct{}{}, - "internal-plugin": struct{}{}, - "push": struct{}{}, - "rpcapi": struct{}{}, + "env": {}, + "internal-plugin": {}, + "push": {}, + "rpcapi": {}, } }