1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cli: improvements to help and error messages (#6375)

This commit is contained in:
Lukas Neubert
2020-09-16 22:01:44 +02:00
committed by GitHub
parent 608df40058
commit 2464deec82
5 changed files with 27 additions and 27 deletions

View File

@ -12,6 +12,7 @@ fn main() {
mut greet_cmd := Command{
name: 'greet'
description: 'Prints greeting in different languages.'
usage: '<name>'
required_args: 1
pre_execute: greet_pre_func
execute: greet_func
@ -44,13 +45,13 @@ fn greet_func(cmd Command) {
name := cmd.args[0]
for _ in 0 .. times {
match language {
'english' {
'english', 'en' {
println('Welcome $name')
}
'german' {
'german', 'de' {
println('Willkommen $name')
}
'dutch' {
'dutch', 'nl' {
println('Welkom $name')
}
else {