Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Jul 1, 2023
1 parent 015ccc2 commit db37d20
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions vlib/cli/command.v
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,12 @@ fn (cmd Command) check_required_flags() {
pub fn (cmd Command) execute_help() {
if cmd.commands.contains('help') {
help_cmd := cmd.commands.get('help') or { return } // ignore error and handle command normally
help_cmd.execute(help_cmd) or { panic(err) }
} else {
print(cmd.help_message())
if !isnil(help_cmd.execute) {
help_cmd.execute(help_cmd) or { panic(err) }
return
}
}
print(cmd.help_message())
}

// execute_help executes the callback registered
Expand Down

0 comments on commit db37d20

Please sign in to comment.