Created
October 30, 2020 07:30
-
-
Save Skeeve/cf596b335f6cb16f2762d1f95e297ccb to your computer and use it in GitHub Desktop.
Mojo::Command usage using Pod::Usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
has usage => sub { | |
my $pod = ''; | |
open my $printpod, '>', \$pod; | |
pod2usage( | |
-input => __FILE__, | |
-verbose => 1, | |
-exitval => 'NOEXIT', | |
-output => $printpod, | |
); | |
close $printpod; | |
return $pod; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.