mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-04 10:57:50 +08:00
eval: Teach (*muster).error correct English
This commit is contained in:
parent
0d3d44f097
commit
0cac402263
|
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user