diff --git a/command/snapshot/save/snapshot_save.go b/command/snapshot/save/snapshot_save.go index 5ac9427c7c72..99350a947b3f 100644 --- a/command/snapshot/save/snapshot_save.go +++ b/command/snapshot/save/snapshot_save.go @@ -73,7 +73,7 @@ func (c *cmd) Run(args []string) int { appendFileNameFlags := strings.Split(c.appendFileNameFlag.String(), ",") - if len(appendFileNameFlags) != 0 { + if len(appendFileNameFlags) != 0 && len(c.appendFileNameFlag.String()) > 0 { agentSelfResponse, err := client.Agent().Self() if err != nil { c.UI.Error(fmt.Sprintf("Error connecting to Consul agent and fetching datacenter/version: %s", err))