source: trunk/essentials/dev-lang/perl/win32/sync_ext.pl@ 3215

Last change on this file since 3215 was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 1.9 KB
Line 
1=comment
2
3Synchronize filename cases for extensions.
4
5This script could be used to perform following renaming:
6if there exist file, for example, "FiLeNaME.c" and
7filename.obj then it renames "filename.obj" to "FiLeNaME.obj".
8There is a problem when some compilers (e.g.Borland) generate
9such .obj files and then "make" process will not treat them
10as dependant and already maked files.
11
12This script takes two arguments - first and second extensions to
13synchronize filename cases with.
14
15There may be specified following options:
16 --verbose <== say everything what is going on
17 --recurse <== recurse subdirectories
18 --dummy <== do not perform actual renaming
19 --say-subdir
20Every such option can be specified with an optional "no" prefix to negate it.
21
22Typically, it is invoked as:
23 perl sync_ext.pl c obj --verbose
24
25=cut
26
27use strict;
28
29my ($ext1, $ext2) = map {quotemeta} grep {!/^--/} @ARGV;
30my %opts = (
31 #defaults
32 'verbose' => 0,
33 'recurse' => 1,
34 'dummy' => 0,
35 'say-subdir' => 0,
36 #options itself
37 (map {/^--([\-_\w]+)=(.*)$/} @ARGV), # --opt=smth
38 (map {/^no-?(.*)$/i?($1=>0):($_=>1)} map {/^--([\-_\w]+)$/} @ARGV), # --opt --no-opt --noopt
39 );