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

cli: show help for empty root command (#6636)

This commit is contained in:
Lukas Neubert
2020-10-17 18:06:27 +02:00
committed by GitHub
parent 3c2202572b
commit dea8662d6b
4 changed files with 27 additions and 3 deletions

View File

@@ -185,6 +185,12 @@ fn (mut cmd Command) parse_commands() {
}
}
}
if cmd.is_root() && int(cmd.execute) == 0 {
if !cmd.disable_help {
cmd.execute_help()
return
}
}
// if no further command was found, execute current command
if cmd.required_args > 0 {
if cmd.required_args > cmd.args.len {