Changeset 5706 for i2c-tools/trunk
- Timestamp:
- 03/20/09 15:40:59 (3 years ago)
- Files:
-
- 1 modified
-
i2c-tools/trunk/eeprom/decode-dimms (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
i2c-tools/trunk/eeprom/decode-dimms
r5705 r5706 42 42 use Fcntl qw(:DEFAULT :seek); 43 43 use vars qw($opt_html $opt_bodyonly $opt_side_by_side $opt_merge 44 $opt_igncheck $use_sysfs $use_hexdump 44 $opt_igncheck $use_sysfs $use_hexdump $sbs_col_width 45 45 @vendors %decode_callback $revision @dimm $current %hexdump_cache); 46 46 … … 393 393 } 394 394 395 my $format = "%-47s".( " %-19s"x (scalar @values - 1))." %s\n";395 my $format = "%-47s".((" %-".$sbs_col_width."s") x (scalar @values - 1))." %s\n"; 396 396 my $maxl = 0; # Keep track of the max number of lines 397 397 … … 1880 1880 } 1881 1881 1882 # Find out the longest value string to adjust the column width 1883 # Note: this could be improved a bit by not taking into account strings 1884 # which will end up being merged. 1885 $sbs_col_width = 15; 1886 if ($opt_side_by_side && !$opt_html) { 1887 for $current (0 .. $#dimm) { 1888 my @output = @{$dimm[$current]->{output}}; 1889 my $line; 1890 my @strings; 1891 1892 for ($line = 0; $line < @output; $line++) { 1893 my ($func, $label, $value) = @{$output[$line]}; 1894 push @strings, split("\n", $value) if defined $value; 1895 } 1896 1897 foreach $line (@strings) { 1898 my $len = length($line); 1899 $sbs_col_width = $len if $len > $sbs_col_width; 1900 } 1901 } 1902 } 1903 1882 1904 # Print the decoded information for all DIMMs 1883 1905 for $current (0 .. $#dimm) {
