mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
test-wrap-argv: return a string in rewrap_arg
Do not print anything, let the caller take care of it.
This commit is contained in:
parent
5e6185eee6
commit
2f071f1fca
@ -104,7 +104,7 @@ sub rewrap_line {
|
|||||||
print join(" \\\n", @env, $cmd), " \\\n";
|
print join(" \\\n", @env, $cmd), " \\\n";
|
||||||
# We might have to split line argument values...
|
# We might have to split line argument values...
|
||||||
for (my $i = 0; $i <= $#args; $i++) {
|
for (my $i = 0; $i <= $#args; $i++) {
|
||||||
&rewrap_arg($args[$i]);
|
print &rewrap_arg($args[$i]);
|
||||||
|
|
||||||
if ($i != $#args) {
|
if ($i != $#args) {
|
||||||
print " \\\n";
|
print " \\\n";
|
||||||
@ -116,6 +116,7 @@ sub rewrap_line {
|
|||||||
|
|
||||||
sub rewrap_arg {
|
sub rewrap_arg {
|
||||||
my $arg = shift;
|
my $arg = shift;
|
||||||
|
my @ret;
|
||||||
|
|
||||||
while (length($arg) > 80) {
|
while (length($arg) > 80) {
|
||||||
my $split = rindex $arg, ",", 80;
|
my $split = rindex $arg, ",", 80;
|
||||||
@ -131,10 +132,9 @@ sub rewrap_arg {
|
|||||||
}
|
}
|
||||||
$split++;
|
$split++;
|
||||||
|
|
||||||
my $head = substr $arg, 0, $split;
|
push @ret, substr $arg, 0, $split;
|
||||||
$arg = substr $arg, $split;
|
$arg = substr $arg, $split;
|
||||||
|
|
||||||
print $head, "\\\n";
|
|
||||||
}
|
}
|
||||||
print $arg;
|
push @ret, $arg;
|
||||||
|
return join("\\\n", @ret);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user