#! /usr/bin/perl
# infocon - Administration tool for InfoCon
-# Copyright (c) 1998-2003,2005-8,10,11,12,14,15,16 Martin Schulze <joey@infodrom.org>
+# Copyright (c) 1998-2003,2005-8,10,11,12,14,15,16,18 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 $opt_verbose = 0;
my $opt_year = 0;
my $opt_date = undef;
+my $opt_grep = undef;
my $opt_direction = undef;
sub sdate
}
}
- if ($where !~ /visible/) {
+ if ($opt_grep) {
+ $where .= " AND " if $where;
+ $where .= sprintf("description ILIKE '%%%s%%'", $opt_grep);
+ }
+
+ if (defined $where && $where !~ /visible/) {
$where .= " AND " if $where;
$where .= "visible = 1";
}
print "infocon [options] [-h|--help] commands\n";
print " --buchung-category|-bc [category]\n";
print " --buchung-input|-bi\n";
- print " --buchung-unpaid\n";
+ print " --buchung-unpaid|-bu\n";
print " --buchung-hidden\n";
print " --date [yyyy-mm-dd|dd.mm.] (for --pay)\n";
print " --pay <nr> | --unpay <nr>\n";
print " --all|-a\n";
print " --csv\n";
print " --verbose|-v\n";
+ print " --grep|-g keyword\n";
print " --year|-y year\n";
print " --direction|--dir|-d in|out\n";
print " --dm\n";
'year=i' => \$opt_year,
'date=s' => \$opt_date,
'direction|d=s' => \$opt_direction,
+ 'grep|g=s' => \$opt_grep,
'mailto:s' => \$data{mailto},
'all' => \$opt_all,
'csv' => \$opt_csv,