X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=inspector%2Fvirt-inspector.pl;h=dae17a8d1e16624e0c55f78209a081d8f4a9566f;hb=3f2ba6fdfbb82234e8a546dc54d568f49cd2e56b;hp=7ab808b8c6d163bdf8bcfa402a29e62405180dee;hpb=22528e9bc486cbb6357192bd758c417c61bba955;p=libguestfs.git
diff --git a/inspector/virt-inspector.pl b/inspector/virt-inspector.pl
index 7ab808b..dae17a8 100755
--- a/inspector/virt-inspector.pl
+++ b/inspector/virt-inspector.pl
@@ -26,7 +26,6 @@ use Sys::Guestfs::Lib qw(open_guest get_partitions resolve_windows_path
use Pod::Usage;
use Getopt::Long;
use Data::Dumper;
-use File::Temp qw/tempdir/;
use XML::Writer;
# Optional:
@@ -89,6 +88,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>
@@ -102,18 +109,6 @@ then libvirt is not used at all.
=cut
-my $force;
-
-=item B<--force>
-
-Force reading a particular guest even if it appears to be active. In
-earlier versions of virt-inspector, this could be dangerous (for
-example, corrupting the guest's disk image). However in more recent
-versions, it should not cause corruption, but might cause
-virt-inspector to crash or produce incorrect results.
-
-=cut
-
my $output = "text";
=back
@@ -185,8 +180,8 @@ default.
=cut
GetOptions ("help|?" => \$help,
+ "version" => \$version,
"connect|c=s" => \$uri,
- "force" => \$force,
"text" => sub { $output = "text" },
"none" => sub { $output = "none" },
"xml" => sub { $output = "xml" },
@@ -200,6 +195,12 @@ GetOptions ("help|?" => \$help,
"windows-registry" => \$windows_registry,
) 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 $rw = 0;
@@ -768,6 +769,8 @@ from L.
Richard W.M. Jones L
+Matthew Booth L
+
=head1 COPYRIGHT
Copyright (C) 2009 Red Hat Inc.