Skip to content

Instantly share code, notes, and snippets.

@Skeeve
Created October 30, 2020 07:30
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 Skeeve/cf596b335f6cb16f2762d1f95e297ccb to your computer and use it in GitHub Desktop.
Save Skeeve/cf596b335f6cb16f2762d1f95e297ccb to your computer and use it in GitHub Desktop.
Mojo::Command usage using Pod::Usage
has usage => sub {
my $pod = '';
open my $printpod, '>', \$pod;
pod2usage(
-input => __FILE__,
-verbose => 1,
-exitval => 'NOEXIT',
-output => $printpod,
);
close $printpod;
return $pod;
};
@Skeeve
Copy link
Author

Skeeve commented Oct 30, 2020

I want the help of mojolicious to return the usage as Pod::Usage with verbosity 1 does.

As the usage function should return a string, this is my proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment