Skip to content

Commit db252d0

Browse files
authored
cli: add pluralization to err msg, if required number of args is not met (#20971)
1 parent 790ea2f commit db252d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vlib/cli/command.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ fn (mut cmd Command) parse_commands() {
230230
// if no further command was found, execute current command
231231
if cmd.required_args > 0 {
232232
if cmd.required_args > cmd.args.len {
233-
eprintln_exit('Command `${cmd.name}` needs at least ${cmd.required_args} arguments')
233+
descriptor := if cmd.required_args == 1 { 'argument' } else { 'arguments' }
234+
eprintln_exit('Command `${cmd.name}` needs at least ${cmd.required_args} ${descriptor}')
234235
}
235236
}
236237
cmd.check_required_flags()

0 commit comments

Comments
 (0)