From cd5a54bc74f8d028ec24fe3e4a3aed9b9c1ad6f0 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Tue, 29 Aug 2017 09:46:14 -0700 Subject: [PATCH] respond to comments --- command/status.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/command/status.go b/command/status.go index 6553c721e..1d4850ec5 100644 --- a/command/status.go +++ b/command/status.go @@ -114,7 +114,7 @@ func (c *StatusCommand) Run(args []string) int { // Only a single result should return, as this is a match against a full id if matchCount > 1 || len(vers) > 1 { - c.outputMultipleMatches(id, res.Matches) + c.logMultiMatchError(id, res.Matches) return 1 } } @@ -139,7 +139,9 @@ func (c *StatusCommand) Run(args []string) int { return cmd.Run(argsCopy) } -func (c *StatusCommand) outputMultipleMatches(id string, matches map[contexts.Context][]string) { +// logMultiMatchError is used to log an error message when multiple matches are +// found. The error message logged displays the matched IDs per context. +func (c *StatusCommand) logMultiMatchError(id string, matches map[contexts.Context][]string) { c.Ui.Error(fmt.Sprintf("Multiple matches found for id %q", id)) for ctx, vers := range matches { if len(vers) == 0 {