- Added export-html.pl.
- Added error handling to export scripts.
This commit is contained in:
Paul Beckingham 2011-04-23 21:34:26 -04:00
parent 8a7f1e03c7
commit 10e3f306dd
7 changed files with 150 additions and 4 deletions

View file

@ -28,10 +28,23 @@
use strict;
use warnings;
use JSON;
# Give a nice error if the (non-standard) JSON module is not installed.
eval "use JSON";
if ($@)
{
print "Error: You need to install the JSON Perl module.\n";
exit 1;
}
# Use the taskwarrior 1.9.4+ _query command to issue a query and return JSON
my $command = '/usr/local/bin/task _query ' . join (' ', @ARGV);
if ($command =~ /No matches/)
{
print stderr $command;
exit 1;
}
# Generate output.
print "BEGIN:VCALENDAR\n",