mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03: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
1 changed files with 2 additions and 1 deletions
|
@ -230,7 +230,8 @@ fn (mut cmd Command) parse_commands() {
|
||||||
// if no further command was found, execute current command
|
// if no further command was found, execute current command
|
||||||
if cmd.required_args > 0 {
|
if cmd.required_args > 0 {
|
||||||
if cmd.required_args > cmd.args.len {
|
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()
|
cmd.check_required_flags()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue