X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=v2v%2Fvirt-v2v.pl;h=5895eaa710f6879f8c6855b14f89900808767c6d;hb=fa36a09e7af4275d53098908bfec2441c4ef9ff1;hp=b7d96865537f010867a773b6b9146a69a3794ee7;hpb=6e790a9d6b225fad4ab080489bd8226c3adb3506;p=libguestfs.git diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl index b7d9686..5895eaa 100755 --- a/v2v/virt-v2v.pl +++ b/v2v/virt-v2v.pl @@ -62,6 +62,14 @@ Display brief help. =cut +my $version; + +=item B<--version> + +Display version number and exit. + +=cut + my $uri; =item B<--connect URI> | B<-c URI> @@ -76,9 +84,16 @@ then libvirt is not used at all. =cut GetOptions ("help|?" => \$help, + "version" => \$version, "connect|c=s" => \$uri, ) or pod2usage (2); pod2usage (1) if $help; +if ($version) { + my $g = Sys::Guestfs->new (); + my %h = $g->version (); + print "$h{major}.$h{minor}.$h{release}$h{extra}\n"; + exit +} pod2usage ("$0: no image or VM names given") if @ARGV == 0; # my $g;