summaryrefslogtreecommitdiffstats
path: root/guestfish.pod
diff options
context:
space:
mode:
authorMatthew Booth <mbooth@redhat.com>2009-09-11 09:27:57 +0100
committerMatthew Booth <mbooth@redhat.com>2009-09-14 13:59:01 +0100
commit22cee80bc2f631703bf417a54ef4e0f0837e921a (patch)
treefd9be63f3951303c5d6f22ab9651f0d2598dfda7 /guestfish.pod
parentf8eb7a18f859fc778d06b9c3f0cafedbeba1e47f (diff)
downloadlibguestfs-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.pod6
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