A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
improve the usage message, and count the total amount of errors
[simgrid.git]
/
tools
/
internal
/
spell_comments.pl
diff --git
a/tools/internal/spell_comments.pl
b/tools/internal/spell_comments.pl
index
4836fba
..
18855d7
100755
(executable)
--- a/
tools/internal/spell_comments.pl
+++ b/
tools/internal/spell_comments.pl
@@
-24,12
+24,15
@@
sub check_content($) {
}
my $TEMPFILE="/tmp/spell.tmp";
}
my $TEMPFILE="/tmp/spell.tmp";
-my $DICTFILE="tools/spell_dict.txt";
-$DICTFILE="spell_dict.txt" unless (-e $DICTFILE);
+my $DICTFILE="tools/
internal/
spell_dict.txt";
+$DICTFILE="
./
spell_dict.txt" unless (-e $DICTFILE);
die "Call this script from its location or from the SimGrid root directory\n" unless (-e $DICTFILE);
die "Call this script from its location or from the SimGrid root directory\n" unless (-e $DICTFILE);
-die "Usage: ./spell_comments.pl `find ../ -name '*.[ch]' -name '*.hpp' -name '*.cpp'`\n"
+die "Usage: ". ($DICTFILE eq "./spell_dict.txt"? "./":"tools/internal/")."spell_comments.pl "
+ ."`find ". ($DICTFILE eq "./spell_dict.txt"? "../../":".")." -name '*.[ch]' -o -name '*.hpp' -o -name '*.cpp'`\n"
unless length(@ARGV)>1;
unless length(@ARGV)>1;
+
+my $total = 0;
foreach my $file (@ARGV) {
open (FI, $file) || die "Cannot open $file: $!\n";
my $content = join ("", <FI>);
foreach my $file (@ARGV) {
open (FI, $file) || die "Cannot open $file: $!\n";
my $content = join ("", <FI>);
@@
-50,7
+53,10
@@
foreach my $file (@ARGV) {
if (@badwords) {
print "$file: ".scalar(@badwords)." errors: '".join("','",@badwords)."'\n";
if (@badwords) {
print "$file: ".scalar(@badwords)." errors: '".join("','",@badwords)."'\n";
+ $total += scalar(@badwords);
}
}
}
}
-unlink($TEMPFILE);
\ No newline at end of file
+print "Total: $total\n";
+
+unlink($TEMPFILE);