diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-11-09 18:48:09 +0100 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-11-14 11:08:14 +0100 |
commit | a9b820abbe46764f23687eac1d1f62b145cd0962 (patch) | |
tree | d14b1428a75428d3ae1286f777e50bb68d6ffd10 /src/args.c | |
parent | 330ca4d3cbd702f4f0e7689a1da4f77945f768e0 (diff) | |
download | calcurse-a9b820abbe46764f23687eac1d1f62b145cd0962.zip |
Use a dynamic method to print events to stdout
Add a flexible helper function print_event() and use it whenever we
print events to stdout. This reduces the number of copy-pasted code and
eventually allows for specifying custom format strings.
Following format specifiers are supported:
* m: Print the description of the item
* n: Print the name of the note file belonging to the item
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/args.c')
-rw-r--r-- | src/args.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -409,9 +409,7 @@ app_arg (int add_line, struct date *day, long date, int print_note, arg_print_date (today); print_date = 0; } - fputs (" * ", stdout); - fputs (ev->mesg, stdout); - fputs ("\n", stdout); + print_event (" * %m\n", today, ev); if (print_note && ev->note) print_notefile (stdout, ev->note, 2); } |