mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-12 09:01:58 -06:00
cb2e9119aa
Signed-off-by: namgyalangmo <75657887+namgyalangmo@users.noreply.github.com>
33 lines
742 B
Go
33 lines
742 B
Go
// Copyright (c) The OpenTofu Authors
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
// Copyright (c) 2023 HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package cloud
|
|
|
|
import (
|
|
"github.com/opentofu/opentofu/internal/backend"
|
|
"github.com/opentofu/opentofu/internal/command/jsonformat"
|
|
)
|
|
|
|
// CLIInit implements backend.CLI
|
|
func (b *Cloud) CLIInit(opts *backend.CLIOpts) error {
|
|
if cli, ok := b.local.(backend.CLI); ok {
|
|
if err := cli.CLIInit(opts); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
b.CLI = opts.CLI
|
|
b.CLIColor = opts.CLIColor
|
|
b.ContextOpts = opts.ContextOpts
|
|
b.runningInAutomation = opts.RunningInAutomation
|
|
b.input = opts.Input
|
|
b.renderer = &jsonformat.Renderer{
|
|
Streams: opts.Streams,
|
|
Colorize: opts.CLIColor,
|
|
}
|
|
|
|
return nil
|
|
}
|