projects
/
infodrom.org
/
service.infodrom.org
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cb06c33
)
Add Readline history for editing task
author
Joey Schulze
<joey@infodrom.org>
Thu, 1 Oct 2015 19:11:49 +0000
(19:11 +0000)
committer
Joey Schulze
<joey@infodrom.org>
Thu, 1 Oct 2015 19:11:49 +0000
(19:11 +0000)
src/InfoCon/stempel/stempel
patch
|
blob
|
history
diff --git
a/src/InfoCon/stempel/stempel
b/src/InfoCon/stempel/stempel
index
be9b66c
..
b3abec9
100755
(executable)
--- a/
src/InfoCon/stempel/stempel
+++ b/
src/InfoCon/stempel/stempel
@@
-1,7
+1,7
@@
#! /usr/bin/perl
#! /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
#
# 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
@@
-299,6
+299,18
@@
sub alter_task
my $term = new Term::ReadLine '';
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) {
my $task = $term->readline ('Aufgabe: ');
if (length($task) > 0) {