]> git.donarmstrong.com Git - bin.git/blob - bibtex_to_paper
add initial start of bibtex to paper
[bin.git] / bibtex_to_paper
1 #!/usr/bin/perl
2 # bibtex_to_paper opens the paper corresponding to a bibtex key
3 # and is released under the terms of the GNU GPL version 3, or any
4 # later version, at your option. See the file README and COPYING for
5 # more information.
6 # Copyright 2013 by Don Armstrong <don@donarmstrong.com>.
7
8
9 use warnings;
10 use strict;
11
12 use Getopt::Long;
13 use Pod::Usage;
14
15 use File::Find;
16 use Text::Bibtex;
17
18 =head1 NAME
19
20 bibtex_to_paper - opens the paper corresponding to a bibtex key
21
22 =head1 SYNOPSIS
23
24 bibtex_to_paper [options] bibtexkey
25
26  Options:
27   --bibtex, -b bibtex file to look up key in
28   --bibtex-cache, -c bibtex cache file
29   --pdf-dir pdf directory
30   --pdfviewer, -p pdf viewer to use
31   --debug, -d debugging level (Default 0)
32   --help, -h display this help
33   --man, -m display manual
34
35 =head1 OPTIONS
36
37 =over
38
39 =item B<--bibtex, -b>
40
41 Bibtex file to look key up in
42
43 =item B<--bibtex-cache, -c>
44
45 Bibtex cache file; rebuilt if bibtex file changes
46
47 =item B<--pdfviewer, -p>
48
49 PDF viewer to use; defaults to evince unless a .xoj exists, in which
50 case xournal is used.
51
52 =item B<--debug, -d>
53
54 Debug verbosity. (Default 0)
55
56 =item B<--help, -h>
57
58 Display brief usage information.
59
60 =item B<--man, -m>
61
62 Display this manual.
63
64 =back
65
66 =head1 EXAMPLES
67
68 bibtex_to_paper
69
70 =cut
71
72
73 use vars qw($DEBUG);
74
75 my %options = (debug           => 0,
76                help            => 0,
77                man             => 0,
78               );
79
80 GetOptions(\%options,
81            'debug|d+','help|h|?','man|m');
82
83 pod2usage() if $options{help};
84 pod2usage({verbose=>2}) if $options{man};
85
86 $DEBUG = $options{debug};
87
88 my @USAGE_ERRORS;
89 if (1) {
90     push @USAGE_ERRORS,"You must pass something";
91 }
92
93 pod2usage(join("\n",@USAGE_ERRORS)) if @USAGE_ERRORS;
94
95
96
97
98 __END__