diff options
| author | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:42 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:42 +0200 |
| commit | 42b79aa5c591dde88e78922a519802f948d9ea60 (patch) | |
| tree | 92cd4e576656837bb99214d8c09c3fec3201474f /scripts/stats.pl | |
| parent | 520f54d6219b7c625b4e07463ac393e6982ddab6 (diff) | |
tagging ychat-0.7.9.4ychat-0.7.9.4
Diffstat (limited to 'scripts/stats.pl')
| -rwxr-xr-x | scripts/stats.pl | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/scripts/stats.pl b/scripts/stats.pl index 38cc67c..96fbdf1 100755 --- a/scripts/stats.pl +++ b/scripts/stats.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -# The yChat Project (2003 - 2004) +# The yhttpd Project (2003 - 2004) # # 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"; @@ -78,7 +76,7 @@ sub filestats $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); |
