mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cli: fix custom help without execute handler (#18732)
This commit is contained in:
parent
7279e49077
commit
5d269ba703
|
@ -294,10 +294,12 @@ fn (cmd Command) check_required_flags() {
|
||||||
pub fn (cmd Command) execute_help() {
|
pub fn (cmd Command) execute_help() {
|
||||||
if cmd.commands.contains('help') {
|
if cmd.commands.contains('help') {
|
||||||
help_cmd := cmd.commands.get('help') or { return } // ignore error and handle command normally
|
help_cmd := cmd.commands.get('help') or { return } // ignore error and handle command normally
|
||||||
help_cmd.execute(help_cmd) or { panic(err) }
|
if !isnil(help_cmd.execute) {
|
||||||
} else {
|
help_cmd.execute(help_cmd) or { panic(err) }
|
||||||
print(cmd.help_message())
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
print(cmd.help_message())
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute_help executes the callback registered
|
// execute_help executes the callback registered
|
||||||
|
|
Loading…
Reference in New Issue
Block a user