Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
RT #126029: sink MAIN (and USAGE)
  • Loading branch information
moritz committed Sep 19, 2015
1 parent a5ef61e commit f7c2a72
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/Main.pm
Expand Up @@ -129,13 +129,17 @@ my sub MAIN_HELPER($retval = 0) {
@matching_candidates .=grep: {!has-unexpected-named-arguments($_.signature, $n)};
# If there are still some candidates left, try to dispatch to MAIN
if +@matching_candidates {
return $m(|@($p), |%($n));
$m(|@($p), |%($n));
return;
}

# We could not find the correct MAIN to dispatch to!
# Let's try to run a user defined USAGE sub
my $h = callframe(1).my<&USAGE>;
return $h() if $h;
if $h {
$h();
return;
}

# We could not find a user defined USAGE sub!
# Let's display the default USAGE message
Expand Down

0 comments on commit f7c2a72

Please sign in to comment.