X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Ffiles%2Ffiledump.pl;h=de91299c081ccff7770a8254a10eb1c689131f4f;hb=d0e1480958985bb8d84cba626076f8f8a3c85344;hp=858fdd80e84d2a50ac560e60740b054d31842f21;hpb=2952ccf47b80174880141a7ecfa122089f349b8d;p=feisty_meow.git diff --git a/scripts/files/filedump.pl b/scripts/files/filedump.pl index 858fdd80..de91299c 100644 --- a/scripts/files/filedump.pl +++ b/scripts/files/filedump.pl @@ -27,7 +27,7 @@ if ($#ARGV < 0) { # iterate over the list of files and dump them to standard output. -foreach $filename (&glob_list(@ARGV)) { +foreach $filename (sort &glob_list(@ARGV)) { &do_dump($filename); } @@ -68,10 +68,14 @@ sub do_dump { $shorter_name =~ s/\.txt$//; $shorter_name =~ s/_/ /g; - $dashed_line = $shorter_name; - $dashed_line =~ s/./-/g; + # we're using the extra equals in front as an almost uniquifier for the + # header lines. we then can treat any matching line as a header, although + # some input files could trick this heuristic. + $munged_name = "= $shorter_name"; + $dashed_line = $munged_name; + $dashed_line =~ s/./=/g; - $header_copy =~ s/%1/$shorter_name/; + $header_copy =~ s/%1/$munged_name/; $header_copy =~ s/%2/$dashed_line/g; ##print $header_copy;