diff options
| author | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:47 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:47 +0200 |
| commit | 2860b03f00e48264ed15c132ad90b240ebe6070b (patch) | |
| tree | 09ed88e28d4a83eb2b1cb17c2d424ba6467292f7 /scripts/stats.pl | |
| parent | eab0b1c2d649fa16707b24cd2a91f195078167b0 (diff) | |
tagging ychat-0.7.9.5ychat-0.7.9.5
Diffstat (limited to 'scripts/stats.pl')
| -rwxr-xr-x | scripts/stats.pl | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/scripts/stats.pl b/scripts/stats.pl index 38cc67c..0eea04d 100755 --- a/scripts/stats.pl +++ b/scripts/stats.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -# The yChat Project (2003 - 2004) +# The yChat Project (2003 - 2005) # # This script generates source code and project statistics @@ -9,6 +9,7 @@ use strict; use scripts::modules::file; my %stats; +my $param = shift; &recursive("."); @@ -17,19 +18,16 @@ $stats{"Lines total"} = $stats{"Lines of source"} + $stats{"Lines of text"} + $stats{"Lines of HTML"}; -my $bool = 0; -foreach ( sort keys %stats ) -{ - if ($bool == 0) - { - print "$_ = " . $stats{$_} . "\n"; - $bool = 1; - } - else - { - print "$_ = " . $stats{$_} . "\n"; - $bool = 0; - } +unless (defined $param) { + + print "$_ = " . $stats{$_} . "\n" + for ( sort keys %stats ); + +} else { + + print $stats{$_} . " " + for sort keys %stats; + } print "\n"; @@ -73,12 +71,12 @@ sub filestats { $stats{"Number of gfx files"}++; } - elsif ( $shift =~ /(\.pl|\.sh|configure.*|Makefile.*)$/ ) + elsif ( $shift =~ /(\.pl|\.pm|\.sh|configure.*|Makefile.*)$/ ) { $stats{"Number of script files"}++; $stats{"Lines of scripts"} += countlines($shift); } - elsif ( $shift =~ /(\.txt|README|INSTALL|COPYING|NEWS|SNAPSHOT|ChangeLog)$/ ) + elsif ( $shift =~ /(\.txt|[A-Z]+)$/ ) { $stats{"Number of text files"}++; $stats{"Lines of text"} += countlines($shift); |
