diff options
author | Richard Jones <rjones@trick.home.annexia.org> | 2009-06-22 08:20:32 +0100 |
---|---|---|
committer | Richard Jones <rjones@trick.home.annexia.org> | 2009-06-22 08:20:32 +0100 |
commit | 05c34c1c1479bb07b31cfbf912743a8cf014a636 (patch) | |
tree | e3e32ce95e36da74aaf06f4af1dbc6fe36b08740 /src | |
parent | 4211c7a258debd236017a19c70965bc1b3658edb (diff) | |
download | libguestfs-05c34c1c1479bb07b31cfbf912743a8cf014a636.tar.gz libguestfs-05c34c1c1479bb07b31cfbf912743a8cf014a636.tar.xz libguestfs-05c34c1c1479bb07b31cfbf912743a8cf014a636.zip |
Add 'glob-expand' command.
Diffstat (limited to 'src')
-rwxr-xr-x | src/generator.ml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/generator.ml b/src/generator.ml index 64a8ab92..b716e0af 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -2373,6 +2373,34 @@ into a list of lines. See also: C<guestfs_command_lines>"); + ("glob_expand", (RStringList "paths", [String "pattern"]), 113, [], + [InitBasicFS, Always, TestOutputList ( + [["mkdir_p"; "/a/b/c"]; + ["touch"; "/a/b/c/d"]; + ["touch"; "/a/b/c/e"]; + ["glob_expand"; "/a/b/c/*"]], ["/a/b/c/d"; "/a/b/c/e"]); + InitBasicFS, Always, TestOutputList ( + [["mkdir_p"; "/a/b/c"]; + ["touch"; "/a/b/c/d"]; + ["touch"; "/a/b/c/e"]; + ["glob_expand"; "/a/*/c/*"]], ["/a/b/c/d"; "/a/b/c/e"]); + InitBasicFS, Always, TestOutputList ( + [["mkdir_p"; "/a/b/c"]; + ["touch"; "/a/b/c/d"]; + ["touch"; "/a/b/c/e"]; + ["glob_expand"; "/a/*/x/*"]], [])], + "expand a wildcard path", + "\ +This command searches for all the pathnames matching +C<pattern> according to the wildcard expansion rules +used by the shell. + +If no paths match, then this returns an empty list +(note: not an error). + +It is just a wrapper around the C L<glob(3)> function +with flags C<GLOB_MARK|GLOB_BRACE>. +See that manual page for more details."); ] |