fix: bad indent when --indent was != 3 (fixes #19)

This commit is contained in:
Stéphane Lesimple 2024-04-14 12:39:27 +02:00
parent 99a6cfdfd1
commit 0264500d22

View file

@ -413,7 +413,7 @@ if ($opt_max_name_len > 0 && $opt_max_name_len < 4) {
$opt_max_name_len = 4;
}
$opt_indent //= 4;
$opt_indent //= 3;
if (defined $opt_profile && $opt_profile !~ /^(raid([0156]|1c[34]|10)|single|dup)$/) {
print STDERR "FATAL: invalid argument for --profile\n";
@ -1002,7 +1002,7 @@ sub longest {
# loop through all the items
foreach my $item (@orderedAll) {
my $len = ($useDepth ? (($item->{depth} || 0) * 3) : 0);
my $len = ($useDepth ? (($item->{depth} || 0) * $opt_indent) : 0);
$len += length($item->{$key} || '');
$longest = $len if $len > $longest;
}