diff options
author | Matthew Booth <mbooth@redhat.com> | 2009-09-11 09:27:57 +0100 |
---|---|---|
committer | Matthew Booth <mbooth@redhat.com> | 2009-09-14 13:59:01 +0100 |
commit | 22cee80bc2f631703bf417a54ef4e0f0837e921a (patch) | |
tree | fd9be63f3951303c5d6f22ab9651f0d2598dfda7 /guestfish.pod | |
parent | f8eb7a18f859fc778d06b9c3f0cafedbeba1e47f (diff) | |
download | libguestfs-22cee80bc2f631703bf417a54ef4e0f0837e921a.tar.gz libguestfs-22cee80bc2f631703bf417a54ef4e0f0837e921a.tar.xz libguestfs-22cee80bc2f631703bf417a54ef4e0f0837e921a.zip |
guestfish: Enable grouping in string lists
This change adds the ability to group entries in a string list with single
quotes. So the string:
"'foo bar'"
becomes 1 token rather than 2. Consequently single quotes must now be escaped:
"\'"
resolves to a literal single quote.
Incidentally, this change also alters another, probably unintentional behaviour
of the previous implementation, in that tokens are separated by any amount of
whitespace rather than a single whitespace character. I.e.:
"a b"
resolves to:
'a' 'b'
rather than:
'a' '' 'b'
That last syntax can be used if an empty argument is still desired. Whitespace
is now also defined to include tabs.
parse_string_list can also now fail if it contains an unmatched open quote.
Diffstat (limited to 'guestfish.pod')
-rw-r--r-- | guestfish.pod | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/guestfish.pod b/guestfish.pod index d24c1628..affb83b3 100644 --- a/guestfish.pod +++ b/guestfish.pod @@ -250,9 +250,13 @@ quotes. For example: rm '/"' A few commands require a list of strings to be passed. For these, use -a space-separated list, enclosed in quotes. For example: +a whitespace-separated list, enclosed in quotes. Strings containing whitespace +to be passed through must be enclosed in single quotes. A literal single quote +must be escaped with a backslash. vgcreate VG "/dev/sda1 /dev/sdb1" + command "/bin/echo 'foo bar'" + command "/bin/echo \'foo\'" =head1 WILDCARDS AND GLOBBING |