mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 03:42:19 +00:00
test-wrap-argv: split out rewrap_arg
Split out the code wrapping the single argument.
This commit is contained in:
parent
a615a2fa58
commit
5e6185eee6
@ -104,7 +104,19 @@ 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++) {
|
||||||
my $arg = $args[$i];
|
&rewrap_arg($args[$i]);
|
||||||
|
|
||||||
|
if ($i != $#args) {
|
||||||
|
print " \\\n";
|
||||||
|
} else {
|
||||||
|
print "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub rewrap_arg {
|
||||||
|
my $arg = shift;
|
||||||
|
|
||||||
while (length($arg) > 80) {
|
while (length($arg) > 80) {
|
||||||
my $split = rindex $arg, ",", 80;
|
my $split = rindex $arg, ",", 80;
|
||||||
if ($split == -1) {
|
if ($split == -1) {
|
||||||
@ -125,10 +137,4 @@ sub rewrap_line {
|
|||||||
print $head, "\\\n";
|
print $head, "\\\n";
|
||||||
}
|
}
|
||||||
print $arg;
|
print $arg;
|
||||||
if ($i != $#args) {
|
|
||||||
print " \\\n";
|
|
||||||
} else {
|
|
||||||
print "\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user