eval: Teach (*muster).error correct English

This commit is contained in:
Qi Xiao 2016-02-22 18:23:12 +01:00
parent 0d3d44f097
commit 0cac402263

View File

@ -1,7 +1,6 @@
package eval
import (
"fmt"
"strconv"
"github.com/elves/elvish/parse"
@ -25,7 +24,11 @@ func (ec *EvalCtx) must(vs []Value, what string, begin, end int) *muster {
func (m *muster) mustLen(l int) {
if len(m.vs) != l {
m.error(fmt.Sprintf("%d values", l), "%d", len(m.vs))
if l == 1 {
m.error("1 value", "%d", len(m.vs))
} else {
m.error(strconv.Itoa(l)+" values", "%d", len(m.vs))
}
}
}