mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
test-wrap-argv: split out rewrap_line
Shorten the rewrap subroutine by splitting out the code dealing with a single line. Also remove $file from the warning.
This commit is contained in:
parent
8ebf780e08
commit
a615a2fa58
@ -59,6 +59,13 @@ sub rewrap {
|
||||
# Now each @lines represents a single command, we
|
||||
# can process them
|
||||
foreach my $line (@lines) {
|
||||
&rewrap_line ($line);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sub rewrap_line {
|
||||
my $line = shift;
|
||||
my @bits = split / /, join('', $line);
|
||||
|
||||
# @bits contains env vars, then the command line
|
||||
@ -107,7 +114,7 @@ sub rewrap {
|
||||
$split = rindex $arg, " ", 80;
|
||||
}
|
||||
if ($split == -1) {
|
||||
warn "$file: cannot find nice place to split '$arg' below 80 chars\n";
|
||||
warn "cannot find nice place to split '$arg' below 80 chars\n";
|
||||
$split = 79;
|
||||
}
|
||||
$split++;
|
||||
@ -124,5 +131,4 @@ sub rewrap {
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user