summaryrefslogtreecommitdiff
path: root/bin/hashl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/hashl')
-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},
);
}