Index: trunk/tools/webfonts-tools/webfonts-mover.pl |
— | — | @@ -1,4 +1,8 @@ |
2 | 2 | #!/usr/bin/perl |
| 3 | +# webfonts-mover.pl |
| 4 | +# A simple program to uninstall and install WebFonts. |
| 5 | +# run perl webfonts-mover.pl --help for more information. |
| 6 | +# Author: Amir E. Aharoni |
3 | 7 | |
4 | 8 | use 5.010; |
5 | 9 | |
— | — | @@ -27,18 +31,47 @@ |
28 | 32 | my $system_fonts_dir = '/usr/share/fonts'; |
29 | 33 | my $dry = 0; |
30 | 34 | my $restore = 0; |
| 35 | +my $help = 0; |
31 | 36 | |
32 | 37 | my $getopt_success = GetOptions( |
33 | 38 | 'source_fonts_dir=s' => \$source_fonts_dir, |
34 | 39 | 'removed_fonts_dir=s' => \$removed_fonts_dir, |
35 | 40 | 'dry' => \$dry, |
36 | 41 | 'restore' => \$restore, |
| 42 | + 'help' => \$help, |
37 | 43 | ); |
38 | 44 | |
39 | 45 | if (not $getopt_success) { |
40 | 46 | croak('Fatal error reading command-line options. Exiting.'); |
41 | 47 | } |
42 | 48 | |
| 49 | +if ($help) { |
| 50 | + say <<"END_USAGE"; |
| 51 | +This programs moves font files that have the same names as in the WebFonts |
| 52 | +extension out of the system fonts directory to a backup directory |
| 53 | +or restores them back. After moving the files it rebuild the cache by |
| 54 | +running fc-cache. |
| 55 | + |
| 56 | +Notes: |
| 57 | +* Currently it only works on Linux. |
| 58 | +* You probably need to run it as a superuser. |
| 59 | +* It's a very preliminary version. Consider backing up your fonts directory. |
| 60 | + |
| 61 | +Command line options: |
| 62 | +--source_fonts_dir The fonts directory in the WebFonts source tree. |
| 63 | + The default is ../../extensions/WebFonts/fonts. |
| 64 | +--removed_fonts_dir The destination directory for removed web fonts. |
| 65 | + The default is ./removed_fonts. |
| 66 | +--dry Don't move files or update the cache. |
| 67 | + Only show which files would be moved and on which |
| 68 | + directories fc-cache would run. |
| 69 | +--restore Moved font files back to the system fonts directory. |
| 70 | + Default is false. |
| 71 | +--help Print this help message. |
| 72 | +END_USAGE |
| 73 | + exit; |
| 74 | +} |
| 75 | + |
43 | 76 | $source_fonts_dir = abs_path($source_fonts_dir); |
44 | 77 | |
45 | 78 | File::Find::find(\&source_fonts, $source_fonts_dir); |
Property changes on: trunk/tools/webfonts-tools/webfonts-mover.pl |
___________________________________________________________________ |
Added: svn:eol-style |
46 | 79 | + native |