]> git.donarmstrong.com Git - bin.git/commitdiff
add initial start of bibtex to paper
authorDon Armstrong <don@donarmstrong.com>
Wed, 22 Jan 2014 17:10:48 +0000 (09:10 -0800)
committerDon Armstrong <don@donarmstrong.com>
Wed, 22 Jan 2014 17:10:48 +0000 (09:10 -0800)
bibtex_to_paper [new file with mode: 0755]

diff --git a/bibtex_to_paper b/bibtex_to_paper
new file mode 100755 (executable)
index 0000000..b3f5c53
--- /dev/null
@@ -0,0 +1,98 @@
+#!/usr/bin/perl
+# bibtex_to_paper opens the paper corresponding to a bibtex key
+# and is released under the terms of the GNU GPL version 3, or any
+# later version, at your option. See the file README and COPYING for
+# more information.
+# Copyright 2013 by Don Armstrong <don@donarmstrong.com>.
+
+
+use warnings;
+use strict;
+
+use Getopt::Long;
+use Pod::Usage;
+
+use File::Find;
+use Text::Bibtex;
+
+=head1 NAME
+
+bibtex_to_paper - opens the paper corresponding to a bibtex key
+
+=head1 SYNOPSIS
+
+bibtex_to_paper [options] bibtexkey
+
+ Options:
+  --bibtex, -b bibtex file to look up key in
+  --bibtex-cache, -c bibtex cache file
+  --pdf-dir pdf directory
+  --pdfviewer, -p pdf viewer to use
+  --debug, -d debugging level (Default 0)
+  --help, -h display this help
+  --man, -m display manual
+
+=head1 OPTIONS
+
+=over
+
+=item B<--bibtex, -b>
+
+Bibtex file to look key up in
+
+=item B<--bibtex-cache, -c>
+
+Bibtex cache file; rebuilt if bibtex file changes
+
+=item B<--pdfviewer, -p>
+
+PDF viewer to use; defaults to evince unless a .xoj exists, in which
+case xournal is used.
+
+=item B<--debug, -d>
+
+Debug verbosity. (Default 0)
+
+=item B<--help, -h>
+
+Display brief usage information.
+
+=item B<--man, -m>
+
+Display this manual.
+
+=back
+
+=head1 EXAMPLES
+
+bibtex_to_paper
+
+=cut
+
+
+use vars qw($DEBUG);
+
+my %options = (debug           => 0,
+               help            => 0,
+               man             => 0,
+              );
+
+GetOptions(\%options,
+           'debug|d+','help|h|?','man|m');
+
+pod2usage() if $options{help};
+pod2usage({verbose=>2}) if $options{man};
+
+$DEBUG = $options{debug};
+
+my @USAGE_ERRORS;
+if (1) {
+    push @USAGE_ERRORS,"You must pass something";
+}
+
+pod2usage(join("\n",@USAGE_ERRORS)) if @USAGE_ERRORS;
+
+
+
+
+__END__