Package: durep / 0.9-3

50_prettify_text_output.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: Improve optical readability of text output.
 During text printing, all subdir indentation is placed
 at the beginning of any relevant line. This make the
 text harder to grasp visually. Instead, move the inserted
 space to just before the file name. This leaves statistics
 aligned and file names indented to reflect directory structure.
Author: Mats Erik Andersson <debian@gisladisker.se>
Forwarded: no
Last-Update: 2014-05-10

--- durep-0.9.debian/durep
+++ durep-0.9/durep
@@ -341,12 +341,12 @@ sub printDir {
   foreach my $entry (@entries) {
     my $numofchars;
     my $percent = $dir->{SIZE} == 0 ? 0 : ($entry->{SIZE}/$dir->{SIZE})*100;
-    print "    " x $indent;
     print prettyFileSize($entry->{SIZE});
     $numofchars = int ((30 / 100) * $percent);
     printf(" [%s%s] ", "#" x $numofchars, " " x (30-$numofchars));
     printf("%6.2f%% ", $percent);
     printf("%s ", shortDate($entry->{MTIME})) if $opt_showdate;
+    print "    " x $indent;
     printf("%s%s\n", $entry->{NAME}, $entry->{TYPE} & $TYPE_DIR ? "/" : "");
     if($entry->{TYPE} & $TYPE_DIR) {
       printDir($entry, $indent+1) if(!defined $opt_textdepth || ($opt_textdepth > $indent+1));