github.com/kanishk98/terraform@v1.3.0-dev.0.20220917174235-661ca8088a6a/internal/cloud/backend_cli.go (about)

     1  package cloud
     2  
     3  import (
     4  	"github.com/hashicorp/terraform/internal/backend"
     5  )
     6  
     7  // CLIInit implements backend.CLI
     8  func (b *Cloud) CLIInit(opts *backend.CLIOpts) error {
     9  	if cli, ok := b.local.(backend.CLI); ok {
    10  		if err := cli.CLIInit(opts); err != nil {
    11  			return err
    12  		}
    13  	}
    14  
    15  	b.CLI = opts.CLI
    16  	b.CLIColor = opts.CLIColor
    17  	b.ContextOpts = opts.ContextOpts
    18  	b.runningInAutomation = opts.RunningInAutomation
    19  	b.input = opts.Input
    20  
    21  	return nil
    22  }