#! /usr/bin/perl
-# Time Tracker
-# Copyright (c) 2007,8,13,14 Martin Schulze <joey@infodrom.org>
+# InfoCon Time Tracker
+# Copyright (c) 2007,8,13,14,15 Martin 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 $term = new Term::ReadLine '';
+ my $sql = q{SELECT customer,task FROM stempel WHERE stop IS NULL};
+ my $sth = $dbh->prepare($sql);
+ $sth->execute;
+ my $row = $sth->fetchrow_hashref;
+
+ my $tasks = tasklist $row->{'customer'};
+ $term->addhistory($_) foreach (@$tasks);
+
+ my $attribs = $term->Attribs;
+ $attribs->{completion_word} = $tasks;
+ $term->{completion_function} = sub {return complete_customer $row->{'customer'}, @_};
+
my $task = $term->readline ('Aufgabe: ');
if (length($task) > 0) {