Skip to content

Instantly share code, notes, and snippets.

@antoniogamiz
Created May 26, 2020 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antoniogamiz/e6e6d8297a25358ea2c0a7145dcbdd9f to your computer and use it in GitHub Desktop.
Save antoniogamiz/e6e6d8297a25358ea2c0a7145dcbdd9f to your computer and use it in GitHub Desktop.
trying to overload a function to detect no arguments passed
package Documentable::CLI {
sub RUN-MAIN(|c) is export {
my %*SUB-MAIN-OPTS = :named-anywhere;
CORE::<&RUN-MAIN>(|c)
}
our proto MAIN(|) is export { * }
multi MAIN () {
say 'Execute "documentable --help" for more information'
}
multi MAIN ( "start" ) {}
}
# no output
Documentable::CLI::MAIN();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment