diff options
author | Karl Berry <karl@freefriends.org> | 2010-07-19 23:16:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-07-19 23:16:46 +0000 |
commit | 277ca449c86a187fe858defdcd6aa1830d3b2d0d (patch) | |
tree | a804dd4e397504655fc225e6f582554780c4115d /Master/texmf-dist/source/latex/stex/bin/rf | |
parent | d515f1120311798486a522c56170bd519d9c6a7a (diff) |
reinstate stex via new .tds.zip
git-svn-id: svn://tug.org/texlive/trunk@19538 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/stex/bin/rf')
-rwxr-xr-x | Master/texmf-dist/source/latex/stex/bin/rf | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/stex/bin/rf b/Master/texmf-dist/source/latex/stex/bin/rf new file mode 100755 index 00000000000..7de36042620 --- /dev/null +++ b/Master/texmf-dist/source/latex/stex/bin/rf @@ -0,0 +1,63 @@ +#!/usr/bin/perl -w + +####################################################################################### +# A tool for computing the module reuse factor for TEX files. # +# Copyright (c) 2005, Ioan Sucan, released under the Gnu General Public License (GPL) # +# see http://www.gnu.org/copyleft/gpl.html # +# $URL: svn://kwarc.eecs.iu-bremen.de/repos/kwarc/projects/content/bin/rf$ # +# $Date: 2005-06-29 23:08:10 +0200 (Wed, 29 Jun 2005) $ $Rev: 3147 $ # +####################################################################################### + +use strict; +use Getopt::Long; +use Modparse; +use Pod::Usage; + +my $input = "-", my $verbose=0, my $stop_at_end=0; +my %arg_snippath; my @snippathList; + +GetOptions("path=s" => \%arg_snippath, + "defpath=s" => \@snippathList, + "verbose" => sub { $verbose=1; }, + "stop" => sub { $stop_at_end=1; }, + "help" => sub { pod2usage(2)}); + +$input = $ARGV[0] if ($#ARGV>=0); + +$main::lc1 = 0; $main::lc2 = 0; +my $mp = Modparse->new(snippathList=>\@snippathList, + snippath=>\%arg_snippath, + stopAtEnd=>$stop_at_end, + verbose=>$verbose, + onEveryLine=>sub { + $main::lc1++; + $main::lc2++ if $_[0]->{depth}==1; }); + +$mp->execute($input); +my $f = ($main::lc2>0)?$main::lc1/$main::lc2:0; +print "Reuse factor: $f\n"; + +__END__ + + +=head1 SYNOPSIS + +rf <input filename> [options] + + This program computes the reuse factor for a .tex document + + Options: + --path XXX specify the value of \XXX (some snippath) in case it is + = somePath not defined in the processed .tex file + --defpath XXX specify which \XXX (snippath definitions) to look for + --stop stop when \end{document} is found; default is to go on + --verbose verbose on + --help this screen + + + Example usage: + ./rf slides.tex -d snippath -v + + Interpretation: + compute the reuse factor for the file slides.tex, look for definitions + of \snippath, in verbose mode |