From 7d2b877afe5c7d26a657e3f7c37a99d83ed2b2c3 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 22 Jan 2006 16:13:34 +0000 Subject: [PATCH] Clearer text output. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3241 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/eeprom/decode-dimms.pl | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/prog/eeprom/decode-dimms.pl b/prog/eeprom/decode-dimms.pl index 449a7db5..eec25212 100755 --- a/prog/eeprom/decode-dimms.pl +++ b/prog/eeprom/decode-dimms.pl @@ -286,8 +286,9 @@ sub printl ($$) # print a line w/ label and value $value =~ s/\n/
\n/sg; print "$label$value\n"; } else { - $value =~ s%\n%\n\t\t%sg; - print "$label\t$value\n"; + my @values = split /\n/, $value; + printf "%-47s %-32s\n", $label, shift @values; + printf "%-47s %-32s\n", "", $_ foreach (@values); } } @@ -301,11 +302,8 @@ sub printl2 ($$) # print a line w/ label and value (outside a table) $value =~ s//\>/sg; $value =~ s/\n/
\n/sg; - print "$label: $value\n"; - } else { - $value =~ s%\n%\n\t\t%sg; - print "$label\t$value\n"; } + print "$label: $value\n"; } sub prints ($) # print seperator w/ given text @@ -384,11 +382,9 @@ if ($opt_body) "\n"; } -printh ' -PC DIMM Serial Presence Detect Tester/Decoder +printh 'PC DIMM Serial Presence Detect Tester/Decoder By Philip Edelbrock, Christian Zuckschwerdt, Burkart Lingner and others -Version 2.9.3 -'; +Version 2.9.3'; my $dimm_count=0; @@ -403,8 +399,8 @@ for my $i ( 0 .. $#dimm_list ) { my $dimm_checksum=0; $dimm_count += 1; - print "

" if $opt_html; - printl2 "Decoding EEPROM", ($use_sysfs ? + print "" if $opt_html; + printl2 "\n\nDecoding EEPROM", ($use_sysfs ? "/sys/bus/i2c/drivers/eeprom/$dimm_list[$i]" : "/proc/sys/dev/sensors/$dimm_list[$i]"); print "" if $opt_html; @@ -789,8 +785,6 @@ for my $i ( 0 .. $#dimm_list ) { print "\n" if $opt_html; } } -print '

' if $opt_html; -printl2 "Number of SDRAM DIMMs detected and decoded", $dimm_count; +printl2 "\n\nNumber of SDRAM DIMMs detected and decoded", $dimm_count; print "\n" if $opt_body; -print "\nTry '$0 --format' for html output.\n" unless $opt_html;