github.com/hugorut/terraform@v1.1.3/src/backend/local/cli.go (about)

     1  package local
     2  
     3  import (
     4  	"log"
     5  
     6  	"github.com/hugorut/terraform/src/backend"
     7  )
     8  
     9  // backend.CLI impl.
    10  func (b *Local) CLIInit(opts *backend.CLIOpts) error {
    11  	b.ContextOpts = opts.ContextOpts
    12  	b.OpInput = opts.Input
    13  	b.OpValidation = opts.Validation
    14  
    15  	// configure any new cli options
    16  	if opts.StatePath != "" {
    17  		log.Printf("[TRACE] backend/local: CLI option -state is overriding state path to %s", opts.StatePath)
    18  		b.OverrideStatePath = opts.StatePath
    19  	}
    20  
    21  	if opts.StateOutPath != "" {
    22  		log.Printf("[TRACE] backend/local: CLI option -state-out is overriding state output path to %s", opts.StateOutPath)
    23  		b.OverrideStateOutPath = opts.StateOutPath
    24  	}
    25  
    26  	if opts.StateBackupPath != "" {
    27  		log.Printf("[TRACE] backend/local: CLI option -backup is overriding state backup path to %s", opts.StateBackupPath)
    28  		b.OverrideStateBackupPath = opts.StateBackupPath
    29  	}
    30  
    31  	return nil
    32  }