diff options
author | Nicholas Clark <nick@ccl4.org> | 2012-04-25 15:21:54 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2013-07-13 12:01:37 +0200 |
commit | bbb454562ee7ec7c6a191910bfa339cb2168a7a2 (patch) | |
tree | 154c983fc5646c6aff2e9673e02210416b9b54ac /installman | |
parent | 3f7e1bf8b573541d1d93e89278657b6e6438b69a (diff) | |
download | perl-bbb454562ee7ec7c6a191910bfa339cb2168a7a2.tar.gz |
Refactor installman's option handling to use Getopt::Long's "multiple names".
Previously installman specified synonyms for options as distinct
options, and then used explicit code to merge them.
Also add -h and -? as synonyms for --help.
Diffstat (limited to 'installman')
-rwxr-xr-x | installman | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/installman b/installman index cd8b0947ff..16278aac41 100755 --- a/installman +++ b/installman @@ -38,7 +38,7 @@ my $usage = GetOptions( \%opts, qw( man1dir=s man1ext=s man3dir=s man3ext=s - destdir:s notify n help silent S verbose V)) + destdir:s notify|n help|h|? silent|S verbose|V)) || die $usage; die $usage if $opts{help}; $opts{destdir} //= ''; @@ -47,9 +47,7 @@ foreach my $pre (qw(man1 man3)) { $opts{"${pre}dir"} //= $opts{destdir} . $Config{"install${pre}dir"}; $opts{"${pre}ext"} //= $Config{"${pre}ext"}; } -$opts{silent} ||= $opts{S}; -$opts{notify} ||= $opts{n}; -$opts{verbose} ||= $opts{V} || $opts{notify}; +$opts{verbose} ||= $opts{notify}; #Sanity checks |