summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-05-18 02:43:27 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-05-18 02:43:27 +0200
commitc2d52326cf091a82635f1332c6133558d92f9463 (patch)
treee59a68c8f40125c3e5318435c0ae45bc7f998558 /bin
parent712c64c4661f8073e464c014c759ceb7f94bc659 (diff)
Fix hashl info <file>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/hashl11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/hashl b/bin/hashl
index 344dd9d..60c383e 100755
--- a/bin/hashl
+++ b/bin/hashl
@@ -119,13 +119,18 @@ sub db_info {
sub file_info {
my ($file) = @_;
+ my $entry = $hashl->file($file);
+
+ if (not $entry) {
+ die("No such file in database\n");
+ }
printf(
"File: %s\nSize: %d bytes (%s)\nHash: %s\n",
$file,
- $hashl->file($file)->{size},
- $hashl->si_size($hashl->file($file)->{size}),
- $hashl->files($file)->{hash},
+ $entry->{size},
+ $hashl->si_size($entry->{size}),
+ $entry->{hash},
);
}