X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=inspector%2Fvirt-inspector.pl;h=cd5427a546210c3604c998817980080db88d9365;hb=7b3c76c95162f773dec03e0555d3060f0d2546c9;hp=02d8851d5e6bc6f04e15b3e7aa5c32c7677d350c;hpb=c1768e07fb207328daa36e3afce3933bcf9ae6cf;p=libguestfs.git
diff --git a/inspector/virt-inspector.pl b/inspector/virt-inspector.pl
index 02d8851..cd5427a 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>
@@ -173,6 +180,7 @@ default.
=cut
GetOptions ("help|?" => \$help,
+ "version" => \$version,
"connect|c=s" => \$uri,
"text" => sub { $output = "text" },
"none" => sub { $output = "none" },
@@ -187,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;
@@ -293,7 +307,7 @@ if ($output eq "fish" || $output eq "ro-fish") {
# Have to mount / first. Luckily '/' is early in the ASCII
# character set, so this should be OK.
foreach (sort keys %$mounts) {
- print "-m $mounts->{$_}:$_ " if $_ ne "swap";
+ print "-m $mounts->{$_}:$_ " if $_ ne "swap" && $_ ne "none";
}
print "\n"
}
@@ -755,6 +769,8 @@ from L.
Richard W.M. Jones L
+Matthew Booth L
+
=head1 COPYRIGHT
Copyright (C) 2009 Red Hat Inc.