Skip to content

Commit

Permalink
cli: add pluralization to err msg, if required number of args is not …
Browse files Browse the repository at this point in the history
…met (#20971)
  • Loading branch information
ttytm committed Mar 7, 2024
1 parent 790ea2f commit db252d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vlib/cli/command.v
Expand Up @@ -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()
Expand Down

0 comments on commit db252d0

Please sign in to comment.