status commands handle uuid prefixes with hyphens

This commit is contained in:
Alex Dadgar
2017-08-29 09:43:28 -07:00
parent 6fb08b844b
commit 0852c0ab3a
7 changed files with 7 additions and 7 deletions

View File

@@ -194,7 +194,7 @@ func (m *monitor) monitor(evalID string, allowPrefix bool) int {
m.ui.Error(fmt.Sprintf("Identifier must contain at least two characters."))
return 1
}
if len(evalID)%2 == 1 {
if hyphens := strings.Count(evalID, "-"); (len(evalID)-hyphens)%2 == 1 {
// Identifiers must be of even length, so we strip off the last byte
// to provide a consistent user experience.
evalID = evalID[:len(evalID)-1]