'bibtex|b=s@',
'bibtex_cache|bibtex-cache|c=s',
'pdfviewer|p=s',
+ 'clear_cache|clear-cache!',
'papers_directory|papers-directory=s@',
'debug|d+','help|h|?','man|m');
}
}
+ if (exists $options{clear_cache}) {
+ clear_cache($dbh,$sth);
+ }
my %entries;
if (exists $options{build_cache}) {
$options{bibtex} //= [];
}
+sub clear_cache {
+ my ($dbh,$sth) = @_;
+ $sth->{clear_papers_cache}->execute();
+ $sth->{clear_bibtex_cache}->execute();
+}
+
sub load_papers_into_database {
my ($dbh,$sth,$dir) = @_;
EOF
select_bibtex_by_file_name => <<'EOF',
SELECT * FROM bibtex WHERE file_name = ?;
+EOF
+ clear_papers_cache => <<'EOF',
+DELETE FROM papers;
+EOF
+ clear_bibtex_cache => <<'EOF',
+DELETE FROM bibtex;
EOF
);
my $st;