summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-04-16 11:58:47 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-04-16 11:58:47 +0200
commit392b62b30a0fe8cfdd6a75b46fb13ac8a7fc8ed9 (patch)
tree97b6d5a044f4f637d5752b76b5429c5b9b637d77
parent7b8795f231fe069892a92bff73345efd6f4def9e (diff)
vdf: Add -i <mountpoints to ignore>
-rwxr-xr-xbin/vdf6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/vdf b/bin/vdf
index cbf676f..7f69e7d 100755
--- a/bin/vdf
+++ b/bin/vdf
@@ -135,7 +135,7 @@ sub show_df_png {
return;
}
-getopts('Aa:cfg', \%opts);
+getopts('Aa:cfgi:', \%opts);
$alpha = $opts{'a'} // 0;
open(my $mounts_fh, '<', '/proc/mounts');
@@ -160,6 +160,10 @@ close($mounts_fh);
if (not $opts{'A'}) {
@mounts = grep { $_->[0] !~ qr{ ^ ( (root|tmp)fs | none ) $ }x } @mounts;
}
+if ($opts{'i'}) {
+ my @ignored = split(qr{,}, $opts{'i'});
+ @mounts = grep { not ($_->[1] ~~ [@ignored]) } @mounts;
+}
if ($opts{'c'}) {
show_df_console();