New API: feature-available.

This API is an easier to use version of the existing guestfs_available,
because the new API returns true/false instead of throwing an error
when a feature from the list is not available.

In truth we've had this implementation internally in the library
and several tools and in Sys::Guestfs::Lib for a long time.  This
change just turns it into a publicly consumable API.
This commit is contained in:
Richard W.M. Jones
2013-04-02 12:27:34 +01:00
parent 288b2b2d4f
commit 1cb38ab924
21 changed files with 84 additions and 130 deletions

View File

@@ -1037,15 +1037,10 @@ containing useful introspection information about the method
}
To test if particular features are supported by the current
build, use the L</available> method like the example below. Note
build, use the L</feature_available> method like the example below. Note
that the appliance must be launched first.
$g->available ( [\"augeas\"] );
Since the L</available> method croaks if the feature is not supported,
you might also want to wrap this in an eval and return a boolean.
In fact this has already been done for you: use
L<Sys::Guestfs::Lib(3)/feature_available>.
$g->feature_available ( [\"augeas\"] );
For further discussion on this topic, refer to
L<guestfs(3)/AVAILABILITY>.