From 0a0eece15ce313cf6b5040594ac42ea4eb67d5b9 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 16 Oct 2018 20:47:23 -0400 Subject: [PATCH] add backend cli options after configuration The cli should override the config --- backend/local/cli.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/local/cli.go b/backend/local/cli.go index f0221b7bde..3385e66393 100644 --- a/backend/local/cli.go +++ b/backend/local/cli.go @@ -14,10 +14,16 @@ func (b *Local) CLIInit(opts *backend.CLIOpts) error { b.OpValidation = opts.Validation b.RunningInAutomation = opts.RunningInAutomation - // Only configure state paths if we didn't do so via the configure func. - if b.StatePath == "" { + // configure any new cli options + if opts.StatePath != "" { b.StatePath = opts.StatePath + } + + if opts.StateOutPath != "" { b.StateOutPath = opts.StateOutPath + } + + if opts.StateBackupPath != "" { b.StateBackupPath = opts.StateBackupPath }