mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virsh: Elide backslash-newline in batch mode
The previous patch made it possible to split multiple commands by adding newline, but not to split a long single command. The sequence backslash-newline was being used as if it were a quoted newline character, rather than completely elided the way the shell does. Again, add more tests, although this time it seems more like I am suffering from a leaning-toothpick syndrome with all the \. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
@@ -414,6 +414,9 @@ mymain(void)
|
||||
/* Tests of multiple commands. */
|
||||
DO_TEST(36, "a\nb\n", " echo a; echo b;");
|
||||
DO_TEST(37, "a\nb\n", "\necho a\n echo b\n");
|
||||
DO_TEST(38, "a\nb\n", "ec\\\nho a\n echo \\\n b;");
|
||||
DO_TEST(39, "a\n b\n", "\"ec\\\nho\" a\n echo \"\\\n b\";");
|
||||
DO_TEST(40, "a\n\\\n b\n", "ec\\\nho a\n echo '\\\n b';");
|
||||
|
||||
# undef DO_TEST
|
||||
|
||||
|
||||
Reference in New Issue
Block a user