summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Jones <rjones@trick.home.annexia.org>2009-07-10 17:57:41 +0100
committerRichard Jones <rjones@trick.home.annexia.org>2009-07-10 17:57:41 +0100
commit995715ebf9935a64f0321c09a527538706aa3cb7 (patch)
tree020ea7902071bc5c0b485e48ad660c55deee6121
parent745f1d9ee8480b3a38f778fcc4506ce86da473a6 (diff)
downloadlibguestfs-995715ebf9935a64f0321c09a527538706aa3cb7.tar.gz
libguestfs-995715ebf9935a64f0321c09a527538706aa3cb7.tar.xz
libguestfs-995715ebf9935a64f0321c09a527538706aa3cb7.zip
Add --version options to virt-df, virt-inspector and virt-v2v.
-rwxr-xr-xdf/virt-df.pl15
-rwxr-xr-xinspector/virt-inspector.pl15
-rwxr-xr-xv2v/virt-v2v.pl15
3 files changed, 45 insertions, 0 deletions
diff --git a/df/virt-df.pl b/df/virt-df.pl
index 2d666a03..0ccc7a8a 100755
--- a/df/virt-df.pl
+++ b/df/virt-df.pl
@@ -82,6 +82,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>
@@ -122,12 +130,19 @@ Print inodes instead of blocks.
=cut
GetOptions ("help|?" => \$help,
+ "version" => \$version,
"connect|c=s" => \$uri,
"csv" => \$csv,
"human-readable|human|h" => \$human,
"inodes|i" => \$inodes,
) 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
+}
# Open the guest handle.
diff --git a/inspector/virt-inspector.pl b/inspector/virt-inspector.pl
index 5f8c8928..3665d377 100755
--- a/inspector/virt-inspector.pl
+++ b/inspector/virt-inspector.pl
@@ -88,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>
@@ -172,6 +180,7 @@ default.
=cut
GetOptions ("help|?" => \$help,
+ "version" => \$version,
"connect|c=s" => \$uri,
"text" => sub { $output = "text" },
"none" => sub { $output = "none" },
@@ -186,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;
diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl
index b7d96865..5895eaa7 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;