mirror of
https://github.com/vlang/v.git
synced 2025-08-04 02:07:28 -04:00
cli: add pluralization to err msg, if required number of args is not met (#20971)
This commit is contained in:
parent
790ea2f1bd
commit
db252d043e
@ -230,7 +230,8 @@ fn (mut cmd Command) parse_commands() {
|
||||
// if no further command was found, execute current command
|
||||
if cmd.required_args > 0 {
|
||||
if cmd.required_args > cmd.args.len {
|
||||
eprintln_exit('Command `${cmd.name}` needs at least ${cmd.required_args} arguments')
|
||||
descriptor := if cmd.required_args == 1 { 'argument' } else { 'arguments' }
|
||||
eprintln_exit('Command `${cmd.name}` needs at least ${cmd.required_args} ${descriptor}')
|
||||
}
|
||||
}
|
||||
cmd.check_required_flags()
|
||||
|
Loading…
x
Reference in New Issue
Block a user