[Pkg-libvirt-commits] [libguestfs] 43/54: java: Document how to use optional parameters in the guestfs-java(3) man page.

Hilko Bengen bengen at moszumanska.debian.org
Sun Mar 9 11:21:17 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch debian
in repository libguestfs.

commit 4f3a7d7af4e18ff08bb1cc2fab2e50746bb01477
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Sat Mar 8 12:13:46 2014 +0000

    java: Document how to use optional parameters in the guestfs-java(3) man page.
    
    (cherry picked from commit 2b3131cf4053b7e39c5185c85ebaef78ce4d586e)
---
 java/examples/guestfs-java.pod | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/java/examples/guestfs-java.pod b/java/examples/guestfs-java.pod
index ae24820..cae70ea 100644
--- a/java/examples/guestfs-java.pod
+++ b/java/examples/guestfs-java.pod
@@ -70,6 +70,43 @@ The output looks similar to this:
  EVENT_TRACE: add_drive_ro = 0
  // etc.
 
+=head2 OPTIONAL ARGUMENTS
+
+Some methods take an optional map of optional parameters.  An example
+of this is C<g.add_drive> which can be called in one of two ways:
+
+ g.add_drive ("disk.img");
+
+or with optional arguments:
+
+ Map<String, Object> optargs =
+   new HashMap<String, Object>() {
+   {
+     put ("readonly", Boolean.TRUE);
+     put ("format", "raw");
+   }
+ };
+ g.add_drive ("disk.img", optargs);
+
+For more information on this topic, see
+L<guestfs(3)/CALLS WITH OPTIONAL ARGUMENTS>.
+
+=head3 Optional handle parameters
+
+When creating the handle you can also pass a map of optional
+parameters:
+
+ Map<String, Object> optargs =
+   new HashMap<String, Object>() {
+   {
+     put ("close_on_exit", Boolean.FALSE);
+     put ("environment", Boolean.TRUE);
+   }
+ };
+ GuestFS g = new GuestFS (optargs);
+
+For more information, see L<guestfs(3)/guestfs_create_flags>.
+
 =head1 EXAMPLE 1: CREATE A DISK IMAGE
 
 @EXAMPLE1@

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list