virCommandToStringFull: Improve linebreaking behaviour

Put multiple values for an option if followed by another option as used
in certain iptables arguments.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Peter Krempa
2021-04-06 15:17:42 +02:00
parent e5124770db
commit 1f61d7129f
3 changed files with 28 additions and 8 deletions

View File

@@ -997,6 +997,7 @@ static int test26(const void *unused G_GNUC_UNUSED)
"--oooh \\\n"
"-f \\\n"
"--wizz 'eek eek' \\\n"
"--m-m-m-multiarg arg arg2 \\\n"
"-w \\\n"
"-z \\\n"
"-l \\\n"
@@ -1009,7 +1010,9 @@ static int test26(const void *unused G_GNUC_UNUSED)
virCommandAddEnvPair(cmd, "A", "B");
virCommandAddEnvPair(cmd, "C", "D E");
virCommandAddArgList(cmd, "--foo", "bar", "--oooh", "-f",
"--wizz", "eek eek", "-w", "-z", "-l",
"--wizz", "eek eek",
"--m-m-m-multiarg", "arg", "arg2",
"-w", "-z", "-l",
"--mmm", "flash", "bang", "wallop",
NULL);