| 1 |
#!perl |
| 2 |
|
| 3 |
use strict; |
| 4 |
use warnings; |
| 5 |
use Getopt::Long qw(GetOptions :config posix_defaults); |
| 6 |
use Pod::Usage; |
| 7 |
use File::Copy::Link qw(copylink); |
| 8 |
|
| 9 |
main() unless caller; |
| 10 |
|
| 11 |
sub main { |
| 12 |
GetOptions ( |
| 13 |
'h|help' => \my $help, |
| 14 |
'm|man' => \my $manual, |
| 15 |
) or |
| 16 |
pod2usage(); |
| 17 |
|
| 18 |
pod2usage(1) if $help; |
| 19 |
pod2usage(-verbose=>2) if $manual; |
| 20 |
pod2usage("$0: no links") unless @ARGV; |
| 21 |
|
| 22 |
copylink for @ARGV; |
| 23 |
} |
| 24 |
|
| 25 |
__END__ |
| 26 |
|
| 27 |
=head1 NAME |
| 28 |
|
| 29 |
copylink - replace a link with a copy of the linked file |
| 30 |
|
| 31 |
=head1 SYNOPSIS |
| 32 |
|
| 33 |
copylink [link ...] |
| 34 |
|
| 35 |
=head1 DESCRIPTION |
| 36 |
|
| 37 |
Each of the links on the command line is replaced by a copy of the file |
| 38 |
that the link points too, so the copy can be edited without changing |
| 39 |
the original. |
| 40 |
|
| 41 |
The command is intended for modifying perl source files created by |
| 42 |
C<./Configure -Dmksymlinks>. |
| 43 |
|
| 44 |
=head2 OPTIONS |
| 45 |
|
| 46 |
=over |
| 47 |
|
| 48 |
=item B<-h>|B<--help> |
| 49 |
|
| 50 |
Show usage and these options |
| 51 |
|
| 52 |
=item B<-m>|B<--man> |
| 53 |
|
| 54 |
Show manual page |
| 55 |
|
| 56 |
=back |
| 57 |
|
| 58 |
=head1 SEE ALSO |
| 59 |
|
| 60 |
File::Copy::Link(3) |
| 61 |
|
| 62 |
=head1 AUTHOR |
| 63 |
|
| 64 |
Robin Barker, <[email protected]> |
| 65 |
|
| 66 |
=head1 COPYRIGHT AND LICENSE |
| 67 |
|
| 68 |
Copyright 2003, 2006, 2011, 2024 by Robin Barker |
| 69 |
|
| 70 |
This library is free software; you can redistribute it and/or modify |
| 71 |
it under the same terms as Perl itself. |
| 72 |
|
| 73 |
=cut |
| 74 |
|
| 75 |
$Id$ |