summaryrefslogtreecommitdiff
path: root/Porting/sync-with-cpan
diff options
context:
space:
mode:
authorH.Merijn Brand <h.m.brand@xs4all.nl>2014-08-01 12:39:06 +0200
committerH.Merijn Brand <h.m.brand@xs4all.nl>2014-08-01 12:39:06 +0200
commit311454c04d15fb2cc6ad80afc47e72759d358c52 (patch)
tree6f5470c06529bbd67acf69413fa3958bb0947670 /Porting/sync-with-cpan
parent54b7cb30429b7e1d106c3acc219e1e77d3c4eea4 (diff)
downloadperl-311454c04d15fb2cc6ad80afc47e72759d358c52.tar.gz
add --help to Porting/sync-with-cpan
Diffstat (limited to 'Porting/sync-with-cpan')
-rwxr-xr-xPorting/sync-with-cpan14
1 files changed, 11 insertions, 3 deletions
diff --git a/Porting/sync-with-cpan b/Porting/sync-with-cpan
index fdbc6ad525..d0cc1d62be 100755
--- a/Porting/sync-with-cpan
+++ b/Porting/sync-with-cpan
@@ -157,12 +157,20 @@ my @problematic = (
);
+sub usage
+{
+ my $err = shift and select STDERR;
+ print "Usage: $0 module [args] [cpan package]\n";
+ exit $err;
+}
+
GetOptions ('tarball=s' => \my $tarball,
'version=s' => \my $version,
- force => \my $force,)
- or die "Failed to parse arguments";
+ force => \my $force,
+ help => sub { usage 0; },
+ ) or die "Failed to parse arguments";
-die "Usage: $0 module [args] [cpan package]" unless @ARGV == 1 || @ARGV == 2;
+usage 1 unless @ARGV == 1 || @ARGV == 2;
sub find_type_f {
my @res;