Skip to content

Commit

Permalink
respond to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed Aug 29, 2017
1 parent a50a3af commit cd5a54b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions command/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand All @@ -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 {
Expand Down

0 comments on commit cd5a54b

Please sign in to comment.