diff options
author | EuAndreh <eu@euandre.org> | 2018-12-29 18:11:49 -0200 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2018-12-29 18:11:49 -0200 |
commit | d51ec3db8ea15a3ec084cc75683ec737b1a78c32 (patch) | |
tree | efd3710871a10d3fa270217de2a8a8d8166298cc /pastebin/website-pastebin | |
parent | Print realpath of generated files. (diff) | |
download | euandre.org-d51ec3db8ea15a3ec084cc75683ec737b1a78c32.tar.gz euandre.org-d51ec3db8ea15a3ec084cc75683ec737b1a78c32.tar.xz |
Improve usage message when arguments are missing.
Diffstat (limited to '')
-rwxr-xr-x | pastebin/website-pastebin | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/pastebin/website-pastebin b/pastebin/website-pastebin index a964449..0426584 100755 --- a/pastebin/website-pastebin +++ b/pastebin/website-pastebin @@ -46,11 +46,15 @@ GetOptions( 'help|h|?' => \$help, 'title|t=s' => \$title ) or pod2usage(-verbose => 1, -exitval => 2); -pod2usage(-verbose => 2, -exitval => 0) if $help; - -if (!$title) { - die "Missing required --title argument."; -} +pod2usage( + -verbose => 2, + -exitval => 0 +) if $help; +pod2usage( + -verbose => 1, + -exitval => 2, + -message => "Missing required --title argument." +) if !$title; # Taken from: # https://stackoverflow.com/a/4009519 @@ -65,7 +69,6 @@ sub slugify { return $input; } - our $dirname = dirname(__FILE__); our $in = "$dirname/skeleton.org"; our $out; |