git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove hard-coded qemu-kvm, replace with $QEMU.
[libguestfs.git]
/
df
/
virt-df.pl
diff --git
a/df/virt-df.pl
b/df/virt-df.pl
index
2d666a0
..
4cac896
100755
(executable)
--- a/
df/virt-df.pl
+++ b/
df/virt-df.pl
@@
-28,6
+28,7
@@
use Getopt::Long;
use Data::Dumper;
use File::Temp qw/tempdir/;
use XML::Writer;
use Data::Dumper;
use File::Temp qw/tempdir/;
use XML::Writer;
+use Locale::TextDomain 'libguestfs';
=encoding utf8
=encoding utf8
@@
-82,6
+83,14
@@
Display brief help.
=cut
=cut
+my $version;
+
+=item B<--version>
+
+Display version number and exit.
+
+=cut
+
my $uri;
=item B<--connect URI> | B<-c URI>
my $uri;
=item B<--connect URI> | B<-c URI>
@@
-122,12
+131,19
@@
Print inodes instead of blocks.
=cut
GetOptions ("help|?" => \$help,
=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;
"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.
# Open the guest handle.
@@
-239,21
+255,21
@@
sub print_stat
sub print_title
{
sub print_title
{
- my @cols = (
"Virtual Machine",
"Filesystem");
+ my @cols = (
__"Virtual Machine", __
"Filesystem");
if (!$inodes) {
if (!$human) {
if (!$inodes) {
if (!$human) {
- push @cols, "1K-blocks";
+ push @cols,
__
"1K-blocks";
} else {
} else {
- push @cols, "Size";
+ push @cols,
__
"Size";
}
}
- push @cols, "Used";
- push @cols, "Available";
- push @cols, "Use%";
+ push @cols,
__
"Used";
+ push @cols,
__
"Available";
+ push @cols,
__
"Use%";
} else {
} else {
- push @cols, "Inodes";
- push @cols, "IUsed";
- push @cols, "IFree";
- push @cols, "IUse%";
+ push @cols,
__
"Inodes";
+ push @cols,
__
"IUsed";
+ push @cols,
__
"IFree";
+ push @cols,
__
"IUse%";
}
if (!$csv) {
}
if (!$csv) {