#! /usr/bin/perl
# InfoCon Time Tracker
-# Copyright (c) 2007,8,13,14,15 Martin Schulze <joey@infodrom.org>
+# Copyright (c) 2007,8,13,14,15,20 Joey Schulze <joey@infodrom.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
my $query = q{SELECT oid,start FROM stempel WHERE stop IS NULL};
my $sth = $dbh->prepare ($query);
if ($sth && $sth->execute > 0) {
- while ((my $row = $sth->fetchrow_hashref)) {
+ if ((my $row = $sth->fetchrow_hashref)) {
my @arr = split(/ /, $row->{start});
my @d = split(/-/, $arr[0]);
$today = 0;
} else {
printf "Task not started today, aborting, use -D if this is intentional.\n";
- next;
+ exit;
}
}
'delete' => \&delete_task,
'reopen' => \&reopen_task,
'task|t' => \&alter_task,
- 'terminate|end|d' => \&close_task,
+ 'terminate|end|d' => sub {close_task(0);},
'D' => sub {close_task(1);},
);
+Getopt::Long::Configure('no_ignore_case');
GetOptions %options;
if ($opt_close) {