Compare commits
95 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f6b8b39d8b | ||
|
|
11ee827a0d | ||
|
|
89bbce8661 | ||
|
|
e1a7f61fb1 | ||
|
|
f310924675 | ||
|
|
2fd7f6d681 | ||
|
|
612b872ed4 | ||
|
|
f97955ded8 | ||
|
|
38907ac6d7 | ||
|
|
1da111ad6e | ||
|
|
c7d0b1c21b | ||
|
|
0c775f7998 | ||
|
|
c872e30ef5 | ||
|
|
2c826b6213 | ||
|
|
9d8777ec7d | ||
|
|
ee06280808 | ||
|
|
da8c3c1a16 | ||
|
|
4346f83f6e | ||
|
|
8b045156d0 | ||
|
|
c4e459e8d7 | ||
|
|
77475136b9 | ||
|
|
362b4a5bc9 | ||
|
|
ff14f0a28a | ||
|
|
a6637db232 | ||
|
|
95f07cf363 | ||
|
|
f9035eec70 | ||
|
|
cc5d44ee9d | ||
|
|
3f97bb0663 | ||
|
|
e268b7f71c | ||
|
|
753305a262 | ||
|
|
cec42bb2c4 | ||
|
|
de7f70ad3e | ||
|
|
046f511d66 | ||
|
|
e2e5b4884c | ||
|
|
05243c9e7a | ||
|
|
fd823871f0 | ||
|
|
4087a82402 | ||
|
|
e8da71498d | ||
|
|
4ab665b876 | ||
|
|
6762af8ffd | ||
|
|
407ef39c54 | ||
|
|
de4194479a | ||
|
|
08188fb811 | ||
|
|
cd89e10cfb | ||
|
|
1c736a319d | ||
|
|
72f84b3c3e | ||
|
|
e8443889bb | ||
|
|
e81fdd1975 | ||
|
|
f9c3103264 | ||
|
|
143666aca0 | ||
|
|
f7fc455b62 | ||
|
|
5814432366 | ||
|
|
90c721295a | ||
|
|
5cf33105a3 | ||
|
|
b23bad9a5b | ||
|
|
c61a295df7 | ||
|
|
aec64afc5c | ||
|
|
72ff15ea7a | ||
|
|
fea19e036a | ||
|
|
98391a0c24 | ||
|
|
2975b9244a | ||
|
|
c78be053cb | ||
|
|
708995093b | ||
|
|
7fea1f6a63 | ||
|
|
b67b27f5cd | ||
|
|
07819a1885 | ||
|
|
e03e1ec7b0 | ||
|
|
fb674a5626 | ||
|
|
410a63fe14 | ||
|
|
2cc625f631 | ||
|
|
51a78ab996 | ||
|
|
d7f9b2165c | ||
|
|
d135dc2337 | ||
|
|
57a11a74e1 | ||
|
|
f73281ee30 | ||
|
|
262e42d42b | ||
|
|
99174d66b6 | ||
|
|
a0838474c4 | ||
|
|
3235ac592f | ||
|
|
dcedbb3076 | ||
|
|
e84c5c4a3c | ||
|
|
c4ec5989fe | ||
|
|
a737b0e0c8 | ||
|
|
f2b7780d6b | ||
|
|
1b6faf57c9 | ||
|
|
76c66b8ab1 | ||
|
|
fe84ddcc98 | ||
|
|
0d832a6848 | ||
|
|
a77d4662f8 | ||
|
|
60915cefd4 | ||
|
|
f896d3f160 | ||
|
|
e23243e195 | ||
|
|
5b14fb63d8 | ||
|
|
081f8f5b3c | ||
|
|
2f18c512e0 |
8
AUTHORS
8
AUTHORS
@@ -1,5 +1,5 @@
|
||||
Principal Author:
|
||||
Paul Beckingham, paul@beckingham.net
|
||||
Paul Beckingham
|
||||
|
||||
Contributing Authors:
|
||||
Damian Glenny
|
||||
@@ -11,6 +11,11 @@ Contributing Authors:
|
||||
Chris Pride
|
||||
Richard Querin
|
||||
Federico Hernandez
|
||||
T. Charles Yun
|
||||
David J Patrick
|
||||
P.C. Shyamshankar
|
||||
Johan Friis
|
||||
Steven de Brouwer
|
||||
|
||||
With thanks to:
|
||||
Eugene Kramer
|
||||
@@ -21,7 +26,6 @@ With thanks to:
|
||||
galvanizd
|
||||
Stas Antons
|
||||
Vincent Fleuranceau
|
||||
T. Charles Yun
|
||||
ArchiMark
|
||||
Carlos Yoder
|
||||
Russell Friesenhahn
|
||||
|
||||
50
ChangeLog
50
ChangeLog
@@ -1,7 +1,51 @@
|
||||
|
||||
------ current release ---------------------------
|
||||
|
||||
1.6.0 (4/12/2009)
|
||||
1.7.0 (5/14/2009)
|
||||
+ Improved the errors when parsing a corrupt or unrecognized pending.data
|
||||
or completed.data file (thanks to T. Charles Yun).
|
||||
+ Added details to the "info" report about recurring tasks (thanks to T.
|
||||
Charles Yun).
|
||||
+ Now writes a sample "defaultwidth" configuration variable to the default
|
||||
.taskrc file (thanks to T. Charles Yun).
|
||||
+ Task allows commands that require an ID to now be given a sequence, which
|
||||
is a set of IDs. This allows commands like "task delete 1 2 5-10,12".
|
||||
+ Fixed bug in the ghistory report, which caused it to only show a new
|
||||
month if a task was added during that month.
|
||||
+ New command "duplicate" which allow existing task(s) to be duplicated,
|
||||
and also have modifications applied (thanks to David J Patrick).
|
||||
+ The "append", and "done" commands now allow modifications to be applied
|
||||
to the task(s) (thanks to David J Patrick).
|
||||
+ Improved word wrapping in various output.
|
||||
+ Fixed bug that added an extra line between header and graph in the
|
||||
ghistory report.
|
||||
+ Added simple 'taskprogram' mailing list subscribe form to the web site.
|
||||
+ For custom reports that define a "limit" to the number of rows of output
|
||||
such as "oldest" and "newest", task allows an override value. For
|
||||
example "task oldest 5" will display the 5 oldest tasks.
|
||||
+ Modified the "stats" report so that it has the same aesthetics as the
|
||||
other reports.
|
||||
+ New "timesheet" command displays tasks completed and started, per week,
|
||||
and can display multiple weeks.
|
||||
+ New tab completion script, task_completion.sh, for bash users, is installed
|
||||
to /usr/local/share/task (thanks to Federico Hernandez).
|
||||
+ Applied patch to allow task to build on Arch Linux (thanks to Johan Friis).
|
||||
+ Applied patch to fix a UUID bug on Solaris 8 (thanks to Steven de Brouwer).
|
||||
+ The task man page is now installed. Try "man task" (thanks to Federico
|
||||
Hernandez and P.C. Shyamshankar).
|
||||
+ Fixed bug that causes task to create a default .task directory, even if
|
||||
data.location specified otherwise (thanks to Federico Hernandez).
|
||||
+ New "edit" command that fires up a text editor (uses 'editor' configuration
|
||||
variable, $VISUAL or $EDITOR environment variable) and allows direct
|
||||
editing of all editable task details.
|
||||
|
||||
------ old releases ------------------------------
|
||||
|
||||
1.6.1 (4/24/2009) 1b6faf57c998617024d0348a87b941a5d2ab2249
|
||||
+ Fixed bug that caused new, first-time .taskrc files to be written without
|
||||
including the custom report labels (thanks to P.C. Shyamshankar).
|
||||
|
||||
1.6.0 (4/12/2009) 06062a96eb57d10dcd7fbe1edf968bb638a0b3a9
|
||||
+ Added support for new "append" command that adds more description text to
|
||||
an existing task.
|
||||
+ Added support for the "weekdays" recurrence, which means a task can recur
|
||||
@@ -43,9 +87,7 @@
|
||||
+ Substitutions can now be made global with /from/to/g and all occurrences
|
||||
of "from" will be replaced with "to".
|
||||
|
||||
------ old releases ------------------------------
|
||||
|
||||
1.5.0 (3/15/2009)
|
||||
1.5.0 (3/15/2009) 87be68e2e83d7bb628be1e5679b16a49a26d3549
|
||||
+ Removed deprecated TUTORIAL file.
|
||||
+ Removed "showage" configuration variable.
|
||||
+ "task stop" can now remove the start time from a started task.
|
||||
|
||||
@@ -18,5 +18,5 @@ included.
|
||||
color.cpp Color support functions.
|
||||
rules.cpp Auto-colorization rules.
|
||||
|
||||
Don't forget, please send bugs, patches to task@beckingham.net
|
||||
Please send bugs, patches to task@beckingham.net
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
SUBDIRS = src
|
||||
EXTRA_DIST = DEVELOPERS
|
||||
|
||||
EXTRA_DIST = task_completion.sh doc/man1/task.1 doc/man5/taskrc.5
|
||||
man1_MANS = doc/man1/task.1
|
||||
man5_MANS = doc/man5/taskrc.5
|
||||
otherdir = $(datadir)/doc/task-1.7.0
|
||||
other_DATA = AUTHORS ChangeLog COPYING INSTALL NEWS README task_completion.sh
|
||||
|
||||
179
Makefile.in
179
Makefile.in
@@ -1,8 +1,8 @@
|
||||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -13,6 +13,7 @@
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
@@ -52,6 +53,20 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
man1dir = $(mandir)/man1
|
||||
am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \
|
||||
"$(DESTDIR)$(otherdir)"
|
||||
man5dir = $(mandir)/man5
|
||||
NROFF = nroff
|
||||
MANS = $(man1_MANS) $(man5_MANS)
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
otherDATA_INSTALL = $(INSTALL_DATA)
|
||||
DATA = $(other_DATA)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
ETAGS = etags
|
||||
@@ -154,10 +169,15 @@ sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
SUBDIRS = src
|
||||
EXTRA_DIST = DEVELOPERS
|
||||
EXTRA_DIST = task_completion.sh doc/man1/task.1 doc/man5/taskrc.5
|
||||
man1_MANS = doc/man1/task.1
|
||||
man5_MANS = doc/man5/taskrc.5
|
||||
otherdir = $(datadir)/doc/task-1.7.0
|
||||
other_DATA = AUTHORS ChangeLog COPYING INSTALL NEWS README task_completion.sh
|
||||
all: auto.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
@@ -212,6 +232,113 @@ $(srcdir)/auto.h.in: $(am__configure_deps)
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f auto.h stamp-h1
|
||||
install-man1: $(man1_MANS) $(man_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
|
||||
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||
else file=$$i; fi; \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
case "$$ext" in \
|
||||
1*) ;; \
|
||||
*) ext='1' ;; \
|
||||
esac; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
|
||||
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
|
||||
done
|
||||
uninstall-man1:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
case "$$ext" in \
|
||||
1*) ;; \
|
||||
*) ext='1' ;; \
|
||||
esac; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
|
||||
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
|
||||
done
|
||||
install-man5: $(man5_MANS) $(man_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)"
|
||||
@list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.5*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||
else file=$$i; fi; \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
case "$$ext" in \
|
||||
5*) ;; \
|
||||
*) ext='5' ;; \
|
||||
esac; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \
|
||||
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \
|
||||
done
|
||||
uninstall-man5:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.5*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
case "$$ext" in \
|
||||
5*) ;; \
|
||||
*) ext='5' ;; \
|
||||
esac; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \
|
||||
rm -f "$(DESTDIR)$(man5dir)/$$inst"; \
|
||||
done
|
||||
install-otherDATA: $(other_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(otherdir)" || $(MKDIR_P) "$(DESTDIR)$(otherdir)"
|
||||
@list='$(other_DATA)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(otherDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(otherdir)/$$f'"; \
|
||||
$(otherDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(otherdir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-otherDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(other_DATA)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(otherdir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(otherdir)/$$f"; \
|
||||
done
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
@@ -288,8 +415,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
@@ -314,8 +441,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) auto.h.in $(TAGS_DEPENDENCIES) \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
@@ -325,13 +452,12 @@ ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) auto.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) auto.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
@@ -402,6 +528,10 @@ dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-lzma: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
@@ -428,6 +558,8 @@ distcheck: dist
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lzma*) \
|
||||
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
@@ -488,9 +620,12 @@ distcleancheck: distclean
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile auto.h
|
||||
all-am: Makefile $(MANS) $(DATA) auto.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(otherdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
@@ -534,7 +669,7 @@ info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
install-data-am: install-man install-otherDATA
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
@@ -544,7 +679,7 @@ install-html: install-html-recursive
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
install-man: install-man1 install-man5
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
@@ -570,7 +705,9 @@ ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
uninstall-am: uninstall-man uninstall-otherDATA
|
||||
|
||||
uninstall-man: uninstall-man1 uninstall-man5
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
|
||||
install-strip
|
||||
@@ -578,17 +715,19 @@ uninstall-am:
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am am--refresh check check-am clean clean-generic \
|
||||
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
|
||||
dist-shar dist-tarZ dist-zip distcheck distclean \
|
||||
dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \
|
||||
distclean-generic distclean-hdr distclean-tags distcleancheck \
|
||||
distdir distuninstallcheck dvi dvi-am html html-am info \
|
||||
info-am install install-am install-data install-data-am \
|
||||
install-dvi install-dvi-am install-exec install-exec-am \
|
||||
install-html install-html-am install-info install-info-am \
|
||||
install-man install-pdf install-pdf-am install-ps \
|
||||
install-ps-am install-strip installcheck installcheck-am \
|
||||
installdirs installdirs-am maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
|
||||
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
|
||||
install-man install-man1 install-man5 install-otherDATA \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
|
||||
tags-recursive uninstall uninstall-am uninstall-man \
|
||||
uninstall-man1 uninstall-man5 uninstall-otherDATA
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
||||
10
NEWS
10
NEWS
@@ -1,4 +1,4 @@
|
||||
Welcome to Task 1.6.0.
|
||||
Welcome to Task 1.7.0.
|
||||
|
||||
Task has been built and tested on the following configurations:
|
||||
|
||||
@@ -10,7 +10,9 @@ Task has been built and tested on the following configurations:
|
||||
- Ubuntu 7 Feisty Fawn
|
||||
- Ubuntu 8 Hardy Heron
|
||||
- Ubuntu 8.10 Intrepid Ibex
|
||||
- Ubuntu 9.04 Jaunty Jackalope (beta)
|
||||
- Ubuntu 9.04 Jaunty Jackalope
|
||||
- Arch Linux
|
||||
- Solaris 8
|
||||
- Solaris 10
|
||||
- Cygwin 1.5.25-14
|
||||
|
||||
@@ -31,5 +33,9 @@ order of increasing effort (to you) and usefulness (to me):
|
||||
will be applied and tested, and a new release will be made. You will be a
|
||||
hero.
|
||||
|
||||
- Another option involves using Github's issue tracker, which can be found
|
||||
at http://github.com/pbeckingham/task/issues which has the advantage that
|
||||
everyone gets to see and track the issue. You will still be a hero.
|
||||
|
||||
Thank you.
|
||||
|
||||
|
||||
8
README
8
README
@@ -14,7 +14,7 @@ Thank you for taking a look at task. Task is a GTD utility featuring:
|
||||
It is intended that features, mainly in the form of reports will be added
|
||||
frequently, with best practices and useful reports evolving from usage patterns.
|
||||
|
||||
Task is scope-limited to GTD functionality only.
|
||||
Task is scope-limited to GTD-like functionality only.
|
||||
|
||||
You may want to watch the old task movie on YouTube:
|
||||
|
||||
@@ -44,7 +44,11 @@ All feedback is welcome, in addition to any bug reports or patches to:
|
||||
|
||||
task@beckingham.net
|
||||
|
||||
Got an idea for an enhancement? Send a message!
|
||||
Or better yet, get involved in the discussion at
|
||||
|
||||
http://groups.google.com/group/taskprogram
|
||||
|
||||
Got an idea for an enhancement? Post a message!
|
||||
|
||||
I have found that task makes me more productive and organized.
|
||||
I hope task can do the same for you.
|
||||
|
||||
44
checklist.txt
Normal file
44
checklist.txt
Normal file
@@ -0,0 +1,44 @@
|
||||
Adding New Command Checklist
|
||||
----------------------------
|
||||
|
||||
- Create new handler in command.cpp or report.cpp.
|
||||
- Add prototype to task.h.
|
||||
- Add call to appropriate section in task.cpp.
|
||||
- Add usage info in task.cpp.
|
||||
- Add command name to list in parse.cpp.
|
||||
- Add unit tests in src/tests.
|
||||
- Add new configuration details to html/config.html.
|
||||
- Add command details to html/advanced.html.
|
||||
- Add description to ChangeLog, with attribution if the idea
|
||||
came from a single user, but not if it came from multiple
|
||||
users.
|
||||
- Add description to html/task.html.
|
||||
|
||||
|
||||
|
||||
Release Checklist
|
||||
-----------------
|
||||
|
||||
- Update "Upcoming Features" document on group
|
||||
- Ensure all unit tests pass on OS X
|
||||
- Ensure clean build on OS X
|
||||
- Make a source package (1)
|
||||
- Ensure clean build on latest Fedora Core from source package
|
||||
- Git clone and rebuild, ensure all unit tests pass
|
||||
- Ensure clean build on latest Ubuntu from source package
|
||||
- Git clone and rebuild, ensure all unit tests pass
|
||||
- Ensure clean build on Windows/Cygwin from source package
|
||||
- Git clone and rebuild, ensure all unit tests pass
|
||||
- Make a new source package (2)
|
||||
- Add actual release date to ChangeLog
|
||||
- Add actual release date to html/task.html
|
||||
- Merge version branch to master
|
||||
- Tag master
|
||||
- Make a new source package (3)
|
||||
- Send source package to package maintainer
|
||||
- Make OS X .pkg package
|
||||
- Wait for all packages
|
||||
- Upload all packages to website
|
||||
- Upload all docs to website
|
||||
- Send announcement to group
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.61)
|
||||
AC_INIT(task, 1.6.0, bugs@beckingham.net)
|
||||
AC_INIT(task, 1.7.0, bugs@beckingham.net)
|
||||
|
||||
CFLAGS="${CFLAGS=}"
|
||||
CXXFLAGS="${CXXFLAGS=}"
|
||||
|
||||
382
doc/man1/task.1
Normal file
382
doc/man1/task.1
Normal file
@@ -0,0 +1,382 @@
|
||||
.TH task 1 2009-05-14 "Task 1.7.0" "User Manuals"
|
||||
|
||||
.SH NAME
|
||||
task \- A command line todo manager.
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B task [subcommand] [args]
|
||||
|
||||
.SH DESCRIPTION
|
||||
Task is a command line TODO list manager. It maintains a list of tasks that you
|
||||
want to do, allowing you to add/remove, and otherwise manipulate them. Task
|
||||
has a rich list of subcommands that allow you to do various things with it.
|
||||
|
||||
.SH SUBCOMMANDS
|
||||
|
||||
.TP
|
||||
.B add [tags] [attrs] description
|
||||
Adds a new task to the task list.
|
||||
|
||||
.TP
|
||||
.B append [tags] [attrs] description
|
||||
Appends more information to an existing
|
||||
task.
|
||||
|
||||
.TP
|
||||
.B annotate ID description
|
||||
Adds an annotation to an existing task.
|
||||
|
||||
.TP
|
||||
.B completed [tags] [attrs] description
|
||||
Provides a chronological listing of all completed tasks matching specified
|
||||
criteria.
|
||||
|
||||
.TP
|
||||
.B ID [tags] [attrs] [description]
|
||||
Modifies the existing task with provided information.
|
||||
|
||||
.TP
|
||||
.B ID /from/to/
|
||||
Performs one substitution on task description for fixing mistakes.
|
||||
|
||||
.TP
|
||||
.B ID /from/to/g
|
||||
Performs all substitutions on task description for fixing mistakes.
|
||||
|
||||
.TP
|
||||
.B duplicate ID [tags] [attrs] [description]
|
||||
Duplicates the specified task and allows modifications.
|
||||
|
||||
.TP
|
||||
.B delete ID
|
||||
Deletes the specified task from task list.
|
||||
|
||||
.TP
|
||||
.B undelete ID
|
||||
Undeletes the specified task, provided a report has not yet been run.
|
||||
|
||||
.TP
|
||||
.B info ID
|
||||
Shows all data and metadata for the specified task.
|
||||
|
||||
.TP
|
||||
.B start ID
|
||||
Marks the specified task as started.
|
||||
|
||||
.TP
|
||||
.B stop ID
|
||||
Removes the
|
||||
.I start
|
||||
time from the specified task.
|
||||
|
||||
.TP
|
||||
.B done ID [tags] [attrs] [description]
|
||||
Marks the specified task as done.
|
||||
|
||||
.TP
|
||||
.B undo ID
|
||||
Marks the specified task as pending, provided a report has not yet been run.
|
||||
|
||||
.TP
|
||||
.B projects
|
||||
Lists all project names used, and the number of tasks for each.
|
||||
|
||||
.TP
|
||||
.B tags
|
||||
Show a list of all tags used.
|
||||
|
||||
.TP
|
||||
.B summary
|
||||
Shows a report of task status by project.
|
||||
|
||||
.TP
|
||||
.B timesheet [weeks]
|
||||
Shows a weekly report of tasks completed and started.
|
||||
|
||||
.TP
|
||||
.B history
|
||||
Shows a report of task history by month.
|
||||
|
||||
.TP
|
||||
.B ghistory
|
||||
Shows a graphical report of task status by month.
|
||||
|
||||
.TP
|
||||
.B next
|
||||
Shows the most important pending tasks for each project.
|
||||
|
||||
.TP
|
||||
.B calendar
|
||||
Shows a monthly calendar with due tasks marked.
|
||||
|
||||
.TP
|
||||
.B active
|
||||
Shows all tasks that are started but not comleted.
|
||||
|
||||
.TP
|
||||
.B overdue
|
||||
Shows all incomplete tasks that are beyond their due date.
|
||||
|
||||
.TP
|
||||
.B stats
|
||||
Shows task database statistics.
|
||||
|
||||
.TP
|
||||
.B import \fIfile
|
||||
Imports tasks from a variety of formats.
|
||||
|
||||
.TP
|
||||
.B export \fIfile
|
||||
Exports all tasks as a CSV file.
|
||||
|
||||
.TP
|
||||
.B color
|
||||
Displays all possible colors.
|
||||
|
||||
.TP
|
||||
.B version
|
||||
Shows the task version number and current settings in the task configuration
|
||||
file.
|
||||
|
||||
.TP
|
||||
.B help
|
||||
Shows the long usage text.
|
||||
|
||||
.SH REPORT SUBCOMMANDS
|
||||
|
||||
A report is a listing of information from the task database. There are several
|
||||
built-in reports currently in task. The output and sort behaviour of these
|
||||
subcommands can be configured in the configuration file.
|
||||
|
||||
.TP
|
||||
.B ls [tags] [attrs] [description]
|
||||
Provides a minimal listing of tasks with specified criteria.
|
||||
|
||||
.TP
|
||||
.B list [tags] [attrs] [description]
|
||||
Provides a more detailed listing of tasks with specified criteria.
|
||||
|
||||
.TP
|
||||
.B long [tags] [attrs] [description]
|
||||
Provides the most detailed listing of tasks with specified criteria.
|
||||
|
||||
.TP
|
||||
.B newest [tags] [attrs] [description] | newest [limit]
|
||||
Shows the newest tasks with specified criteria.
|
||||
|
||||
.TP
|
||||
.B oldest [tags] [attrs] [description] | oldest [limit]
|
||||
Shows the oldest tasks with specified criteria
|
||||
|
||||
.SH ATTRIBUTES AND METADATA
|
||||
|
||||
.TP
|
||||
.B ID
|
||||
Tasks can be specified uniquely by IDs, which are simply the index of the
|
||||
task in a report. Be careful, as the IDs of tasks may change after a
|
||||
modification to the database. Always run a report to check you have the right
|
||||
ID for a task. IDs can be given to task as a sequence, for example,
|
||||
.br
|
||||
.B
|
||||
task del 1 2 5-10,12
|
||||
|
||||
.TP
|
||||
.B +tag|-tag
|
||||
Tags are arbitrary words associated with a task. Use + to add a tag and - to
|
||||
remove a tag from a task.
|
||||
|
||||
.TP
|
||||
.B project:<project-name>
|
||||
Specify the project to which a task is related to.
|
||||
|
||||
.TP
|
||||
.B priority:H|M|L|N
|
||||
Specify High, Medium, Low and No priority for a task.
|
||||
|
||||
.TP
|
||||
.B due:<due-date>
|
||||
Specify the due-date of a task.
|
||||
|
||||
.TP
|
||||
.B until:<end-date-of-recurrence>
|
||||
Specify the Recurrence end-date of a task.
|
||||
|
||||
.TP
|
||||
.B recur:<frequency>
|
||||
Specify the frequency of recurrence of a task.
|
||||
|
||||
.TP
|
||||
.B fg:<color-spec>
|
||||
Specify foreground color.
|
||||
|
||||
.TP
|
||||
.B bg:<color-spec>
|
||||
Specify background color.
|
||||
|
||||
.TP
|
||||
.B rc:<path>
|
||||
Specify alternate configuration file.
|
||||
|
||||
.SH SPECIFYING DATES AND FREQUENCIES
|
||||
|
||||
.SS DATES
|
||||
Task reads dates from the commandline and displays dates in the
|
||||
reports. The expected and desired date format is determined by the
|
||||
configuration variable
|
||||
.I dateformat
|
||||
in the task configuration file.
|
||||
|
||||
.RS
|
||||
.TP
|
||||
Exact specification
|
||||
task ... due:7/14/2008
|
||||
|
||||
.TP
|
||||
Relative wording
|
||||
task ... due:today
|
||||
.br
|
||||
task ... due:yesterday
|
||||
.br
|
||||
task ... due:tomorrow
|
||||
|
||||
.TP
|
||||
Day number with ordinal
|
||||
task ... due:23rd
|
||||
|
||||
.TP
|
||||
End of week (Friday), month and year
|
||||
task ... due:eow
|
||||
.br
|
||||
task ... due:eom
|
||||
.br
|
||||
task ... due:eoy
|
||||
|
||||
.TP
|
||||
Next occuring weekday
|
||||
task ... due:fri
|
||||
.RE
|
||||
|
||||
.SS FREQUENCIES
|
||||
Recurrence periods. Task supports several ways of specifying the
|
||||
.I frequency
|
||||
of recurring tasks.
|
||||
|
||||
.RS
|
||||
.TP
|
||||
daily, day, 1d, 2d, ...
|
||||
Every day or a number of days.
|
||||
|
||||
.TP
|
||||
weekdays
|
||||
Mondays, Tuesdays, Wednesdays, Thursdays, Fridays and skipping weekend days.
|
||||
|
||||
.TP
|
||||
weekly, 1w, 2w, ...
|
||||
Eery week or a number of weeks.
|
||||
|
||||
.TP
|
||||
biweekly, fortnight
|
||||
Every two weeks.
|
||||
|
||||
.TP
|
||||
quaterly, 1q, 2q, ...
|
||||
Every three months, a quarter, or a number of quaters.
|
||||
|
||||
.TP
|
||||
semiannual
|
||||
Every six months.
|
||||
|
||||
.TP
|
||||
annual, yearly, 1y, 2y, ...
|
||||
Every year or a number of years.
|
||||
|
||||
.TP
|
||||
biannual, biyearly, 2y
|
||||
Every two years.
|
||||
.RE
|
||||
|
||||
|
||||
.SH COMMAND ABBREVIATION
|
||||
All task commands may be abbreviated as long as a unique prefix is used. E.g.
|
||||
|
||||
.RS
|
||||
$ task li
|
||||
.RE
|
||||
|
||||
is an unambiguous abbreviation for
|
||||
|
||||
.RS
|
||||
$ task list
|
||||
.RE
|
||||
|
||||
but
|
||||
|
||||
.RS
|
||||
$ task l
|
||||
.RE
|
||||
|
||||
could be list, ls or long.
|
||||
|
||||
.SH EXAMPLES
|
||||
|
||||
A small section for examples e.g. some stuff from
|
||||
.br
|
||||
http://www.beckingham.net/30second.html
|
||||
.br
|
||||
http://www.beckingham.net/simple.html
|
||||
|
||||
.SH FILES
|
||||
|
||||
.TP
|
||||
~/.taskrc User configuration file.
|
||||
|
||||
.TP
|
||||
~/.task The default directory where task stores its data files. The location
|
||||
can be configured in the configuration file.
|
||||
|
||||
.TP
|
||||
~/.task/pending.data The file that contains the tasks that are not yet done.
|
||||
|
||||
.TP
|
||||
~/.task/completed.data The file that contains the completed "done" tasks.
|
||||
|
||||
.SH "CREDITS & COPYRIGHTS"
|
||||
task was written by P. Beckingham <task@beckingham.net>.
|
||||
.br
|
||||
Copyright (C) 2006 \- 2009 P. Beckingham
|
||||
|
||||
This manpage was originally written by P.C. Shyamshankar, and has been modified
|
||||
and supplemented by Federico Hernandez.
|
||||
|
||||
task is distributed under the GNU General Public License. See
|
||||
http://www.gnu.org/licenses/gpl-2.0.txt for more information.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR taskrc (5)
|
||||
|
||||
For more information regarding task, the following may be referenced:
|
||||
|
||||
.TP
|
||||
<http://www.beckingham.net/task.html>
|
||||
The official site.
|
||||
|
||||
.TP
|
||||
<http://groups.google.com/group/taskprogram>
|
||||
The official mailing list.
|
||||
|
||||
.TP
|
||||
<http://github.com/pbeckingham/task/>
|
||||
The official code repository.
|
||||
|
||||
.SH REPORTING BUGS
|
||||
Bugs in task may be reported to the issue-tracker at
|
||||
|
||||
.RS
|
||||
<http://github.com/pbeckingham/task/issues>
|
||||
.RE
|
||||
|
||||
or to the mailing list at
|
||||
|
||||
.RS
|
||||
<http://groups.google.com/group/taskprogram>
|
||||
.RE
|
||||
411
doc/man5/taskrc.5
Normal file
411
doc/man5/taskrc.5
Normal file
@@ -0,0 +1,411 @@
|
||||
.TH taskrc 5 2009-05-14 "Task 1.7.0" "User Manuals"
|
||||
|
||||
.SH NAME
|
||||
taskrc \- Configuration file for the task(1) command
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B $HOME/.taskrc
|
||||
.B task rc:<directory-path>/.taskrc
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B task
|
||||
obtains its configuration data from a file called
|
||||
.I .taskrc
|
||||
\&. This file is normally located in the user's home directory:
|
||||
|
||||
.RS
|
||||
$HOME/.taskrc
|
||||
.RE
|
||||
|
||||
The default location can be overriden using the
|
||||
.I rc:
|
||||
attribute when running task:
|
||||
|
||||
.RS
|
||||
$ task rc:<directory-path>/.taskrc
|
||||
.RE
|
||||
|
||||
If
|
||||
.B task
|
||||
is run without an existing configuration file it will ask if it should create a default, sample
|
||||
.I .taskrc
|
||||
file in the user's home directory.
|
||||
|
||||
The task configuration file consists of a series of "assignments" in each line. The "assignments" have the syntax:
|
||||
|
||||
.RS
|
||||
<name-of-configuration-variable>=<value-to-be-set>
|
||||
.RE
|
||||
|
||||
where:
|
||||
.RS
|
||||
.TP
|
||||
<name-of-configuration-variable>
|
||||
is one of the variables described below
|
||||
|
||||
.TP
|
||||
<value-to-be-set>
|
||||
is the value the variable is to be set to.
|
||||
.RE
|
||||
|
||||
and set a configuration variable to a certain value. The equal sign ("=") is used to separate the variable
|
||||
name from the value to be set.
|
||||
|
||||
The hash mark, or pounf sign ("#") is used as a "comment" character. It can be used to annotte the
|
||||
configuration file. It is placed at the beginning of a line and all text after the character to the
|
||||
end of the line is ignored.
|
||||
|
||||
.SH CONFIGURATION VARIABLES
|
||||
Valid variable names and their default values are:
|
||||
|
||||
.TP
|
||||
.B data.location=$HOME/.task
|
||||
This is a path to the directory containing all the task files. By default, it is set up to be ~/.task,
|
||||
for example: /Users/paul/.task
|
||||
|
||||
.TP
|
||||
.B confirmation=yes
|
||||
May be "yes" or "no", and determines whether task will ask for confirmation before deleting a task.
|
||||
|
||||
.TP
|
||||
.B echo.command=yes
|
||||
May be "yes" or "no", and causes task to display the ID and description of any task when you run the start, stop, do, undo, delete and undelete commands. The default value is "yes".
|
||||
|
||||
.TP
|
||||
.B next=2
|
||||
Is a number, defaulting to 2, which is the number of tasks for each project that are shown in the
|
||||
.B task next
|
||||
command.
|
||||
|
||||
.TP
|
||||
.B dateformat=m/d/Y
|
||||
This is a string of characters that define how task formats dates. The default value is: m/d/Y.
|
||||
The string should contain the characters
|
||||
|
||||
.RS
|
||||
m minimal-digit month, for example 1 or 12
|
||||
.br
|
||||
d minimal-digit day, for example 1 or 30
|
||||
.br
|
||||
y two-digit year, for example 09
|
||||
.br
|
||||
D two-digit day, for example 01 or 30
|
||||
.br
|
||||
M two-digit month, for example 01 or 12
|
||||
.br
|
||||
Y four-digit year, for example 2009
|
||||
.RE
|
||||
|
||||
The string may also contain other characters to act as spacers, or formatting. Examples for other
|
||||
variable values:
|
||||
|
||||
.RS
|
||||
.br
|
||||
d/m/Y would output 24/7/2009
|
||||
.br
|
||||
YMD would output 20090724
|
||||
.br
|
||||
m-d-y would output 07-24-09
|
||||
.RE
|
||||
|
||||
.TP
|
||||
.B monthsperline=99
|
||||
Determines how many months the "task calendar" command renders across the screen.
|
||||
Defaults to however many will fit. If more months that will fit are specified,
|
||||
task will only show as many that will fit.
|
||||
|
||||
.TP
|
||||
.B defaultwidth=80
|
||||
The width of tables used when ncurses support is not available. Defaults to 80.
|
||||
|
||||
.TP
|
||||
.B curses=on
|
||||
Determines whether task uses ncurses to establish the size of the window you are
|
||||
using, for text wrapping.
|
||||
|
||||
.TP
|
||||
.B due=7
|
||||
This is the number of days into the future that define when a task is considered due,
|
||||
and is colored accordingly. Defaults to 7.
|
||||
|
||||
.TP
|
||||
.B nag=You have higher priority tasks.
|
||||
This may be a string of text, or blank. It is used as a prompt when a task is completed
|
||||
that is not considered high priority. The "task next" command lists important tasks, and
|
||||
completing one of those does not generate this nagging. Default value is: You have higher
|
||||
priority tasks.
|
||||
|
||||
.TP
|
||||
.B locking=on
|
||||
Determines whether task uses file locking when accessing the pending.data and completed.data files.
|
||||
Default to "on". Solaris users who store the task data files on an NFS mount may need to set locking
|
||||
to "off". Note that setting this value to "off" is dangerous. It means that another program may write
|
||||
to the task.pending file when task is attempting to do the same.
|
||||
|
||||
.TP
|
||||
.B editor=vi
|
||||
Specifies which text editor you wish to use for when the
|
||||
.B task edit <ID>
|
||||
command is used. Task will first look for this configuration variable. If found, it is used.
|
||||
Otherwise task will look for the $VISUAL or $EDITOR environment variables, before it defaults
|
||||
to using "vi".
|
||||
|
||||
.TP
|
||||
.B color=on
|
||||
May be "on" or "off". Determines whether task uses color. When "off", task will
|
||||
use dashes (-----) to underline column headings.
|
||||
|
||||
Task has a number of coloration rules. They correspond to a particular attribute
|
||||
of a task, such as it being due, or being active, and specifies the automatic
|
||||
coloring of that task. A list of valid color, depending on your terminal, can be
|
||||
obtained by running the command
|
||||
|
||||
.RS
|
||||
.B task color
|
||||
.RE
|
||||
|
||||
.RS
|
||||
The coloration rules and their defaults are:
|
||||
.RE
|
||||
|
||||
.RS
|
||||
.RS
|
||||
.B color.overdue=bold_red
|
||||
.br
|
||||
.B color.due=bold_yellow
|
||||
.br
|
||||
.B color.pri.H=bold
|
||||
.br
|
||||
.B color.pri.M=on_yellow
|
||||
.br
|
||||
.B color.pri.L=on_green
|
||||
.br
|
||||
.B color.pri.none=white on_blue
|
||||
.br
|
||||
.B color.active=bold_cyan
|
||||
.br
|
||||
.B color.tagged=yellow
|
||||
.br
|
||||
.B color.recurring=on_red
|
||||
.RE
|
||||
.RE
|
||||
|
||||
.RS
|
||||
The value for the coloration rules may be one optional foreground color and one optional
|
||||
color. For example, the value may be
|
||||
.RE
|
||||
|
||||
.RS
|
||||
.RS
|
||||
bold_red on_bright_yellow
|
||||
.RE
|
||||
.RE
|
||||
|
||||
.RS
|
||||
Certain attributes like tags, projects and keywords can also have their own coloration rules.
|
||||
.RE
|
||||
|
||||
.RS
|
||||
.TP
|
||||
.B color.tag.X=yellow
|
||||
Colors any task that has the tag X.
|
||||
|
||||
.TP
|
||||
.B color.project.X=on_green
|
||||
Colors any task assigned to project X.
|
||||
|
||||
.TP
|
||||
.B color.keyword.X=on_blue
|
||||
Colors any task where the description contains X.
|
||||
.RE
|
||||
|
||||
.TP
|
||||
.B
|
||||
shadow.file=$HOME/.task/shadow.txt
|
||||
If specified, designates a file path that will be autoamtically written to by task,
|
||||
whenever the task database changes. In other words, it is automatically kept up to date.
|
||||
The shadow.command configuration variable is used to determine which report is written
|
||||
to the shadow file. There is no color used in the shadow file. This feature can be useful
|
||||
in maintaining a current file for use by programs like GeekTool, Conky or Samurize.
|
||||
|
||||
.TP
|
||||
.B
|
||||
shadow.command=list
|
||||
This is the command that is run to maintain the shadow file, determined by the
|
||||
.I shadow.file
|
||||
configuration variable. The format is identical to that of
|
||||
.I default.command
|
||||
\&. Please see the corresponding documentation for that command.
|
||||
|
||||
.TP
|
||||
.B
|
||||
shadow.notify=on
|
||||
When this value is set to "on", task will display a message whenever the shadow
|
||||
file is updated by some task command.
|
||||
|
||||
.TP
|
||||
.B
|
||||
default.project=foo
|
||||
Provides a default project name for the
|
||||
.I task add
|
||||
command.
|
||||
|
||||
.TP
|
||||
.B
|
||||
default.priority=M
|
||||
Provides a default priority for the
|
||||
.I task add
|
||||
command.
|
||||
|
||||
.TP
|
||||
.B
|
||||
default.command=list
|
||||
Provides a default command that is run every time task is invoked with no arguments.
|
||||
For example, if set to:
|
||||
|
||||
.RS
|
||||
.RS
|
||||
default.command=list project:foo
|
||||
.RE
|
||||
.RE
|
||||
|
||||
.RS
|
||||
Then task will run the "list project:foo" command if no command is specified. This means that
|
||||
by merely typing
|
||||
.RE
|
||||
|
||||
.RS
|
||||
.RS
|
||||
$ task
|
||||
.br
|
||||
[task list project:foo]
|
||||
.br
|
||||
\&
|
||||
.br
|
||||
ID Project Pri Description
|
||||
1 foo H Design foo
|
||||
2 foo Build foo
|
||||
.RE
|
||||
.RE
|
||||
|
||||
The built in reports can be customized by using the following configuration variables.
|
||||
The output columns, their labels and the sort order can be set using the corresponding
|
||||
variables for each report.
|
||||
|
||||
.TP
|
||||
.B
|
||||
report.long.description
|
||||
Lists all task, all data, matching the specified criteria
|
||||
|
||||
.TP
|
||||
.B
|
||||
report.long.labels=ID,Project,Pri,Added,Started,Due,Recur,Age,Tags,Description
|
||||
.RE
|
||||
.B
|
||||
report.long.columns=id,project,priority,entry,start,due,recur,age,tags,description
|
||||
.B
|
||||
report.long.sort=due+,priority-,project+
|
||||
|
||||
.TP
|
||||
.B
|
||||
report.list.description
|
||||
Lists all tasks matching the specified criteria
|
||||
|
||||
.TP
|
||||
.B
|
||||
report.list.labels=ID,Project,Pri,Due,Active,Age,Description
|
||||
.RE
|
||||
.B
|
||||
report.list.columns=id,project,priority,due,active,age,description
|
||||
.B
|
||||
report.list.sort=due+,priority-,project+
|
||||
|
||||
|
||||
.TP
|
||||
.B
|
||||
report.ls.description
|
||||
Minimal listing of all tasks matching the specified criteria
|
||||
|
||||
.TP
|
||||
.B
|
||||
report.ls.labels=ID,Project,Pri,Description
|
||||
.RE
|
||||
.B
|
||||
report.ls.columns=id,project,priority,description
|
||||
.B
|
||||
report.ls.sort=priority-,project+
|
||||
|
||||
.TP
|
||||
.B
|
||||
report.newest.description
|
||||
Shows the newest tasks
|
||||
|
||||
.TP
|
||||
.B
|
||||
report.newest.labels=ID,Project,Pri,Due,Active,Age,Description
|
||||
.RE
|
||||
.B
|
||||
report.newest.columns=id,project,priority,due,active,age,description
|
||||
.B
|
||||
report.newest.sort=id-
|
||||
.B
|
||||
report.newest.limit=10
|
||||
|
||||
|
||||
.TP
|
||||
.B
|
||||
report.oldest.description
|
||||
Shows the oldest tasks
|
||||
|
||||
.TP
|
||||
.B
|
||||
report.oldest.labels=ID,Project,Pri,Due,Active,Age,Description
|
||||
.RE
|
||||
.B
|
||||
report.oldest.columns=id,project,priority,due,active,age,description
|
||||
.B
|
||||
report.oldest.sort=id+
|
||||
.B
|
||||
report.oldest.limit=10
|
||||
|
||||
|
||||
.SH "CREDITS & COPYRIGHTS"
|
||||
task was written by P. Beckingham <task@beckingham.net>.
|
||||
.br
|
||||
Copyright (C) 2006 \- 2009 P. Beckingham
|
||||
|
||||
This man page was originally written by Federico Hernandez. It is based on the task man page, which
|
||||
was originally written by P.C. Shyamshankar.
|
||||
|
||||
task is distributed under the GNU General Public License. See
|
||||
http://www.gnu.org/licenses/gpl-2.0.txt for more information.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR task (1)
|
||||
|
||||
For more information regarding task, the following may be referenced:
|
||||
|
||||
.TP
|
||||
<http://www.beckingham.net/task.html>
|
||||
The official site.
|
||||
|
||||
.TP
|
||||
<http://groups.google.com/group/taskprogram>
|
||||
The official mailing list.
|
||||
|
||||
.TP
|
||||
<http://github.com/pbeckingham/task/>
|
||||
The official code repository.
|
||||
|
||||
.SH REPORTING BUGS
|
||||
Bugs in task may be reported to the issue-tracker at
|
||||
|
||||
.RS
|
||||
<http://github.com/pbeckingham/task/issues>
|
||||
.RE
|
||||
|
||||
or to the mailing list at
|
||||
|
||||
.RS
|
||||
<http://groups.google.com/group/taskprogram>
|
||||
.RE
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
@@ -121,6 +120,13 @@ ID Project Pri Due Active Age Description
|
||||
variable.
|
||||
</p>
|
||||
|
||||
<strong>% task duplicate 1 /foo/bar/g +tag priority:H</strong>
|
||||
<p>
|
||||
This duplicates task 1, then applies the modifications specified,
|
||||
which change all "foo" to "bar" in the description and annotations,
|
||||
adds the tag "tag", and sets the priority to "H".
|
||||
</p>
|
||||
|
||||
<strong>% task delete <id></strong>
|
||||
<p>
|
||||
There are two ways of getting rid of tasks - mark them as done, or
|
||||
@@ -219,6 +225,24 @@ Year Month Added Completed Deleted Net
|
||||
number decreased as more task were completed than added.
|
||||
</p>
|
||||
|
||||
<strong>% task ghistory</strong>
|
||||
<p>
|
||||
The ghistory report is a "graphical" version of the history
|
||||
report. It shows a colored bar graph and legend.
|
||||
</p>
|
||||
|
||||
<strong>% task timesheet 2</strong>
|
||||
<p>
|
||||
The timesheet report shows a list of tasks completed and started
|
||||
during a one-week period. In the example above, 2 weeks of tasks
|
||||
are shown.
|
||||
</p>
|
||||
<p>
|
||||
By default, the report starts on a Monday. To override this
|
||||
value, add an entry to your .taskrc file like this:
|
||||
<pre><code>weekstart=Sunday</code></pre>
|
||||
</p>
|
||||
|
||||
<strong>% task calendar</strong>
|
||||
<p>
|
||||
This report shows a calendar of the current month, with any task
|
||||
@@ -277,16 +301,24 @@ ID Project Pri Description
|
||||
12 Errand L Remember to deposit bonus check
|
||||
...</code></pre>
|
||||
|
||||
<strong>% task oldest</strong>
|
||||
<strong>% task oldest [limit]</strong>
|
||||
<p>
|
||||
Lists the oldest tasks. Shows 10 tasks by default, but can be
|
||||
set via the "oldest" configuration variable.
|
||||
Lists the oldest tasks. The number of tasks shown is set by
|
||||
the configuration variable:
|
||||
<pre><code>report.oldest.limit=10</code></pre>
|
||||
This value can be overridden at run time by specifying the
|
||||
number of tasks on the command line:
|
||||
<pre><code>task oldest 5</code></pre>
|
||||
</p>
|
||||
|
||||
<strong>% task newest</strong>
|
||||
<strong>% task newest [limit]</strong>
|
||||
<p>
|
||||
Lists the newest tasks. Shows 10 tasks by default, but can be
|
||||
set via the "newest" configuration variable.
|
||||
Lists the newest tasks. The number of tasks shown is set by
|
||||
the configuration variable:
|
||||
<pre><code>report.newest.limit=10</code></pre>
|
||||
This value can be overridden at run time by specifying the
|
||||
number of tasks on the command line:
|
||||
<pre><code>task newest 5</code></pre>
|
||||
</p>
|
||||
|
||||
<strong>% task <id> /from/to/</strong>
|
||||
@@ -401,6 +433,22 @@ ID Project Pri Description
|
||||
command.
|
||||
</p>
|
||||
|
||||
<strong>% task <id> edit</strong>
|
||||
<p>
|
||||
This command allows you to use your text editor to edit all aspects
|
||||
of a task. The specified task will be written to a file, and your
|
||||
text editor will be invoked. If you modify the task in the text
|
||||
editor, task will update accordingly.
|
||||
</p>
|
||||
<p>
|
||||
Task will first check to see if you have defined a text editor
|
||||
in the 'editor' configuration variable. If not, task will
|
||||
check to see if you defined a text editor in the VISUAL
|
||||
environment variable. If not task will check to see if you
|
||||
defined a text editor in the EDITOR environment variable.
|
||||
If all those fail, task launches vi.
|
||||
</p>
|
||||
|
||||
<strong>% task <id> fg:... bg:...</strong>
|
||||
<p>
|
||||
Not strictly a command, the setting of the fg and bg (foreground
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
@@ -186,6 +185,24 @@
|
||||
only show as many that will fit.
|
||||
</dd>
|
||||
|
||||
<dt>weekstart</dt>
|
||||
<dd>
|
||||
The day of the week that represents the first day of the week.
|
||||
Defaults to "Monday".
|
||||
</dd>
|
||||
|
||||
<dt>editor</dt>
|
||||
<dd>
|
||||
Specifies which text editor you wish to use for when the
|
||||
|
||||
<pre><code>task edit <ID></code></pre>
|
||||
|
||||
command is used. Task will first look for this configuration
|
||||
variable. If found, it is used. Otherwise task will look
|
||||
for the VISUAL or EDITOR environment variables, before it
|
||||
defaults to using 'vi'.
|
||||
</dd>
|
||||
|
||||
<dt>defaultwidth</dt>
|
||||
<dd>
|
||||
The width of tables used when ncurses support is not available.
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
@@ -63,6 +62,8 @@
|
||||
They are text files, so they can just be copied to another
|
||||
location for safekeeping. Don't forget there is also the
|
||||
~/.taskrc file that contains your task configuration data.
|
||||
To be sure, and to future-proof your backup, consider backing
|
||||
up all the files in the ~/.task directory.
|
||||
</p>
|
||||
<hr>
|
||||
|
||||
@@ -108,6 +109,69 @@
|
||||
</p>
|
||||
<hr>
|
||||
|
||||
<p>
|
||||
<b>
|
||||
Q: I'm using Ubuntu 9.04, and I want task to word-wrap
|
||||
descriptions. How do I do this?
|
||||
</b>
|
||||
<br />
|
||||
A: You need to install ncurses, by doing this:
|
||||
<code><pre>% sudo apt-get install libncurses5-dev</pre></code>
|
||||
Then you need to rebuild task from scratch, starting with
|
||||
<code><pre>% cd task-X.X.X
|
||||
% ./configure
|
||||
...</pre></code>
|
||||
The result should be a task program that knows the width
|
||||
of the terminal window, and wraps accordingly.
|
||||
</p>
|
||||
<hr>
|
||||
|
||||
<p>
|
||||
<b>
|
||||
Q: How do I build task under Cygwin?
|
||||
</b>
|
||||
<br />
|
||||
A: Task is built the same way everywhere. But under Cygwin, you'll
|
||||
need to make sure you have the following packages available
|
||||
first:
|
||||
|
||||
<ul>
|
||||
<li>gcc
|
||||
<li>make
|
||||
<li>libncurses-devel
|
||||
<li>libncurses8
|
||||
</ul>
|
||||
|
||||
The gcc and make packages allow you to compile the code, and
|
||||
are therefore required, but the ncurses packages are optional.
|
||||
Ncurses will allow task to determine the width of the window, and
|
||||
therefore use the whole width and wrap text accordingly, for a
|
||||
more aesthetically pleasing display.
|
||||
</p>
|
||||
<hr>
|
||||
|
||||
<p>
|
||||
<b>
|
||||
Q: Do colors work under Cygwin?
|
||||
</b>
|
||||
<br />
|
||||
A: They do, but only in a limited way. You can use regular
|
||||
foreground colors (black, red, green ...) and you can
|
||||
regular background colors (on_black, on_red, on_green ...),
|
||||
but underline and bold are not supported.
|
||||
<br />
|
||||
<br />
|
||||
If you run the command:
|
||||
<code><pre>% task colors</pre></code>
|
||||
Task will display all the colors it can use, and you will
|
||||
see which ones you can use.
|
||||
<br />
|
||||
<br />
|
||||
See the <a href="color.html">color</a> documentation for
|
||||
more details on which colors can be used.
|
||||
</p>
|
||||
<hr>
|
||||
|
||||
<!--
|
||||
<p>
|
||||
<b>
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
|
||||
409
html/git.html
Normal file
409
html/git.html
Normal file
@@ -0,0 +1,409 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>git</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="task.css" type="text/css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="container">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<div id="toolbar">
|
||||
<a href="task.html">Home</a>
|
||||
<a href="setup.html">Setup</a>
|
||||
<a href="30second.html">30-second Tutorial</a>
|
||||
<a href="simple.html">Simple</a>
|
||||
<a href="advanced.html">Advanced</a>
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<h2 class="title"><a name="simple">Using git</a></h2>
|
||||
<div class="content">
|
||||
<p>
|
||||
First you need to tell git who you are. These commands will
|
||||
write to ~/.gitconfig, and will be used to identify you when
|
||||
you commit changes. Plus, I like color.
|
||||
</p>
|
||||
|
||||
<pre><code>% git config --global user.name "John Doe"
|
||||
% git config --global user.email "john@doe.com"
|
||||
% git config --global color.ui=always</code></pre>
|
||||
|
||||
<p>
|
||||
Now we will clone the repository, which involves downloading
|
||||
about 2MB of files. Git repositories are very compact. We
|
||||
will clone the repository from github. This takes a minute or
|
||||
so.
|
||||
</p>
|
||||
|
||||
<pre><code>% cd
|
||||
% git clone git://github.com/pbeckingham/task.git task.git
|
||||
% cd task.git</code></pre>
|
||||
|
||||
<p>
|
||||
You just pulled the entire history of task changes since it
|
||||
was uploaded to github. That will be missing about a year and
|
||||
a half of prior changes, which were in Subversion. Let's
|
||||
build task:
|
||||
</p>
|
||||
|
||||
<pre><code>% autoreconf
|
||||
...
|
||||
% ./configure --prefix=/usr/local
|
||||
...
|
||||
% make
|
||||
...</code></pre>
|
||||
|
||||
<p>
|
||||
The task binary will be in the src directory. If you run:
|
||||
</p>
|
||||
|
||||
<pre><code>% sudo make install</code></pre>
|
||||
|
||||
<p>
|
||||
Then task will be copied to /usr/local/bin, according the
|
||||
--prefix argument used above. /usr/local is the default
|
||||
prefix, so that argument wasn't necessary, but illustrates
|
||||
it's use.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Meanwhile, you have just created a local copy of the
|
||||
repository. You can do anything to this copy except push to
|
||||
github. Only the repository owner can push to github, or
|
||||
additional users identified by the owner (with additional
|
||||
monthly github fee). In order to get your changes back to
|
||||
github, they have to go through the owner, either in the form
|
||||
of a patch via email, or by creating your own github account,
|
||||
pushing to you own task repository clone (github calls it a
|
||||
fork), then asking the owner to pull directly from your
|
||||
repository.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You only need to clone once, unless you feel like starting
|
||||
over, or creating additional clones. Ordinarily, you update
|
||||
your local copy by pulling changes from github with:
|
||||
</p>
|
||||
|
||||
<pre><code>% git pull</code></pre>
|
||||
|
||||
<p>
|
||||
Right now, nothing new should be pulled, because you just
|
||||
cloned. Sometimes you'll see changes that have either been
|
||||
made by the owner, or merged in from others, by the owner.
|
||||
Let's take a look at the commit history:
|
||||
</p>
|
||||
|
||||
<pre><code>% git log</code></pre>
|
||||
|
||||
<p>
|
||||
You see a whole series of commits. Each commit is a set of
|
||||
file changes that were made somewhere. Let's look at branches.
|
||||
Try this:
|
||||
</p>
|
||||
|
||||
<pre><code>% git branch
|
||||
* master</code></pre>
|
||||
|
||||
<p>
|
||||
This is telling you that you have only one branch, called
|
||||
master. The asterisk tells you that this is your current
|
||||
branch, which is redundant because you only have one. But
|
||||
there are other branches on github. See those with:
|
||||
</p>
|
||||
|
||||
<pre><code>% git branch -a
|
||||
* master
|
||||
remotes/origin/1.6.1
|
||||
remotes/origin/1.7.0
|
||||
remotes/origin/HEAD -> origin/master
|
||||
remotes/origin/master</code></pre>
|
||||
|
||||
<p>
|
||||
A remote is what git calls another repository. The origin
|
||||
remote is the repository that this clone originated from.
|
||||
This output tells you that there is a 1.6.1 branch on github,
|
||||
a 1.7.0 branch on github, and a master branch on github. It's
|
||||
not obvious, but your local master (the first one shown) is
|
||||
tracking remotes/origin/master, which means changes on the
|
||||
remote will get merged to the local tracking branch on pull.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The convention used by task is to create a new branch whenever
|
||||
work begins on a new version. When that version is released,
|
||||
the branch is merged to master, but retained. At time of
|
||||
writing, 1.6.1 is the currently released version of task, and
|
||||
so remotes/origin/1.6.1 and remotes/origin/master are
|
||||
currently identical, with all new development happening on the
|
||||
1.7.0 branch. When 1.7.0 is released, it will get merged to
|
||||
master, and the 1.6.1 branch will be deleted. Nothing will be
|
||||
lost, because 1.6.1 is already merged to master. Let's look
|
||||
at tags:
|
||||
</p>
|
||||
|
||||
<pre><code>% git tag</code></pre>
|
||||
...
|
||||
v1.4.3
|
||||
v1.5.0
|
||||
v1.6.0
|
||||
v1.6.1
|
||||
|
||||
<p>
|
||||
Those tags are just labels that represent the last commit for
|
||||
that version. You may notice that a change in the tag naming
|
||||
convention, that occurred when the owner realized that git
|
||||
will not allow a tag and a branch of the same name at the same
|
||||
time, so now there is a "v" in the tags.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Let's make a branch called 1.7.0 that tracks changes to
|
||||
remotes/origin/1.7.0. That means you can pull 1.7.0 changes
|
||||
from github into your local branch, to keep up to date.
|
||||
</p>
|
||||
|
||||
<pre><code>% git checkout -b 1.7.0 origin/1.7.0
|
||||
Branch 1.7.0 set up to track remote branch 1.7.0 from origin.
|
||||
Switched to a new branch '1.7.0'
|
||||
|
||||
% git branch -a
|
||||
* 1.7.0
|
||||
master
|
||||
remotes/origin/1.6.1
|
||||
remotes/origin/1.7.0
|
||||
remotes/origin/HEAD -> origin/master
|
||||
remotes/origin/master</code></pre>
|
||||
|
||||
<p>
|
||||
Now you can see that 1.7.0 is your current branch (*). That
|
||||
means you are looking at the 1.7.0 codebase. Let us now
|
||||
assume you intend to make a change, and submit the patch. We
|
||||
will add Solaris 8 as a supported OS. This will affect two
|
||||
files. First check status:
|
||||
</p>
|
||||
|
||||
<pre><code>% git status
|
||||
# On branch 1.7.0
|
||||
nothing to commit (working directory clean)</code></pre>
|
||||
|
||||
<p>
|
||||
No changes. That's what we expect. Now make the changes (any
|
||||
editor will suffice, but assume vi):
|
||||
</p>
|
||||
|
||||
<pre><code>% vi NEWS
|
||||
% vi html/task.html</code></pre>
|
||||
|
||||
<p>
|
||||
Now we expect to see changes. Status says:
|
||||
</p>
|
||||
|
||||
<pre><code>% git status
|
||||
# On branch 1.7.0
|
||||
# Changed but not updated:
|
||||
# (use "git add <file>..." to update what will be committed)
|
||||
# (use "git checkout -- <file>..." to discard changes in working directory)
|
||||
#
|
||||
# modified: NEWS
|
||||
# modified: html/task.html
|
||||
#
|
||||
no changes added to commit (use "git add" and/or "git commit -a")</code></pre>
|
||||
|
||||
<p>
|
||||
Git sees that those two files have changed, but as git states,
|
||||
they are not added to the commit. Git allows you to stage
|
||||
changes, then commit the staged changes - a two-step process
|
||||
that gives you complete control. Git also allows you to
|
||||
commit all changes and bypass the staging, but that's a
|
||||
shortcut that is risky, because you can inadvertently commit
|
||||
things you didn't want to. Let's see what git thinks changed:
|
||||
</p>
|
||||
|
||||
<pre><code>% git diff
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 74adecd..30d4f8f 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -12,6 +12,7 @@ Task has been built and tested on the following configurations:
|
||||
- Ubuntu 8.10 Intrepid Ibex
|
||||
- Ubuntu 9.04 Jaunty Jackalope
|
||||
- Arch Linux
|
||||
+ - Solaris 8
|
||||
- Solaris 10
|
||||
- Cygwin 1.5.25-14
|
||||
|
||||
diff --git a/html/task.html b/html/task.html
|
||||
index 66ee777..a2254f6 100644
|
||||
--- a/html/task.html
|
||||
+++ b/html/task.html
|
||||
@@ -193,6 +193,7 @@
|
||||
<li>Ubuntu 8.10 Intrepid Ibex
|
||||
<li>Ubuntu 9.04 Jaunty Jackalope
|
||||
<li>Arch Linux
|
||||
+ <li>Solaris 8
|
||||
<li>Solaris 10
|
||||
<li>Cygwin 1.5.25-14
|
||||
</ul></code></pre>
|
||||
|
||||
<p>
|
||||
Git has correctly spotted the changes. The "git diff" command
|
||||
always tells you the difference between the last commit and
|
||||
the current state. Now we will stage the two changes:
|
||||
</p>
|
||||
|
||||
<pre><code>% git add NEWS html/task.html
|
||||
% git diff</code></pre>
|
||||
|
||||
<p>
|
||||
No changes are reported. That's because if files are staged,
|
||||
then diff shows the difference between the staged files and
|
||||
the current state. We staged all changes, hence no diff. If
|
||||
we wanted to see the difference between the last commit and
|
||||
the staged files, try this:
|
||||
</p>
|
||||
|
||||
<pre><code>% git diff --cached
|
||||
(same as unstaged diff)</code></pre>
|
||||
|
||||
<p>
|
||||
Now the status shows that the files are staged:
|
||||
</p>
|
||||
|
||||
<pre><code>% git status
|
||||
# On branch 1.7.0
|
||||
# Changes to be committed:
|
||||
# (use "git reset HEAD <file>..." to unstage)
|
||||
#
|
||||
# modified: NEWS
|
||||
# modified: html/task.html
|
||||
#</code></pre>
|
||||
|
||||
<p>
|
||||
Now a commit command will commit the staged files:
|
||||
</p>
|
||||
|
||||
<pre><code>% git commit -m "Added Solaris 8 as a supported platform"
|
||||
[1.7.0 03308eb] Added Solaris 8 as a suported platform
|
||||
2 files changed, 2 insertions(+), 0 deletions(-)</code></pre>
|
||||
|
||||
<p>
|
||||
Now make a patch:
|
||||
</p>
|
||||
|
||||
<pre><code>% git format-patch HEAD^
|
||||
0001-Added-Solaris-8-as-a-supported-platform.patch</code></pre>
|
||||
|
||||
<p>
|
||||
HEAD is a label that means the current head of the branch, or
|
||||
in other words, what was last committed. HEAD^ means the
|
||||
commit before that. HEAD~2 is the one before that, HEAD~3
|
||||
etc. When we say create a patch of HEAD^, it means the same
|
||||
as:
|
||||
</p>
|
||||
|
||||
<pre><code>% git diff HEAD^</code></pre>
|
||||
|
||||
<p>
|
||||
Which means show the difference between the previous commit
|
||||
and the current commit, but the patch has extra identifying
|
||||
information in it. Take a look at that patch file. If you
|
||||
ran:
|
||||
</p>
|
||||
|
||||
<pre><code>% git format-patch HEAD~10</code></pre>
|
||||
|
||||
<p>
|
||||
Git will create 10 patch files, one for each commit. To get
|
||||
the patch applied to the repository, email it to the owner.
|
||||
The owner will then apply the patch with:
|
||||
</p>
|
||||
|
||||
<pre><code>owner> git apply 0001-Added-Solaris-8-as-a-supported-platform.patch</code></pre>
|
||||
|
||||
<p>
|
||||
Then push the changes with:
|
||||
</p>
|
||||
|
||||
<pre><code>owner> git push</code></pre>
|
||||
|
||||
<p>
|
||||
And that makes them available on github, which means in turn
|
||||
that the next time you run:
|
||||
</p>
|
||||
|
||||
<pre><code>% git pull</code></pre>
|
||||
|
||||
<p>
|
||||
Your changes will have come full circle.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<div class="content">
|
||||
<p>
|
||||
Copyright 2006-2009, P. Beckingham. All rights reserved.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td align="right" valign="top" width="200px">
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<script type="text/javascript"><!--
|
||||
google_ad_client = "pub-9709799404235424";
|
||||
/* Task Main */
|
||||
google_ad_slot = "8660617875";
|
||||
google_ad_width = 120;
|
||||
google_ad_height = 600;
|
||||
//-->
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
||||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var pageTracker = _gat._getTracker("UA-4737637-1");
|
||||
pageTracker._initData();
|
||||
pageTracker._trackPageview();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
@@ -52,7 +51,7 @@
|
||||
generated on a regular basis. Consider the example:
|
||||
</p>
|
||||
|
||||
<pre><code>% task Pay rent due:7/1/2008 recur:monthly</code></pre>
|
||||
<pre><code>% task add Pay rent due:7/1/2008 recur:monthly</code></pre>
|
||||
|
||||
<p>
|
||||
If today's date is 7/10, for example, then that due date is in the past, and
|
||||
@@ -81,7 +80,7 @@ ID Project Pri Due Active Age Description
|
||||
Thursdays instead:
|
||||
</p>
|
||||
|
||||
<pre><code>% task TPS report due:thursday recur:weekly until:8/31/2008</code></pre>
|
||||
<pre><code>% task add TPS report due:thursday recur:weekly until:8/31/2008</code></pre>
|
||||
|
||||
<p>
|
||||
This create a weekly recurring task that expires on 8/31/2008. What this means
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Task Troubleshooting Guide</title>
|
||||
<title>Task Usage</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="task.css" type="text/css" />
|
||||
</head>
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
@@ -32,73 +31,72 @@
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<h1 class="title">Task Troubleshooting Guide</h1>
|
||||
<p>
|
||||
Here you will find tips and suggestions for making task behave
|
||||
properly, and bug workarounds.
|
||||
</p>
|
||||
|
||||
<br />
|
||||
<h2 class="title">Segmentation Fault for certain commands</h2>
|
||||
<h1 class="title">ID Sequences</h1>
|
||||
<div class="content">
|
||||
<p>
|
||||
Upgrading task to version 1.1.0, 1.2.0 and 1.3.0 can cause
|
||||
segmentation faults. This is mostly occurring for Ubuntu users,
|
||||
although there is no reason for it to be limited to Ubuntu.
|
||||
Some task commands require an ID to be specified. For example:
|
||||
</p>
|
||||
|
||||
<pre><code>% task 3 done</code></pre>
|
||||
|
||||
<p>
|
||||
This marks a single task as done. But if you wanted to mark
|
||||
several tasks as done, you could use:
|
||||
</p>
|
||||
|
||||
<pre><code>% task 3,4,5 done</code></pre>
|
||||
|
||||
<p>
|
||||
Which would mark tasks 3, 4 and 5 as all done. In this example,
|
||||
the three IDs are consecutive, which means you could also have
|
||||
entered:
|
||||
</p>
|
||||
|
||||
<pre><code>% task 3-5 done</code></pre>
|
||||
|
||||
<p>
|
||||
Or in a more complex example:
|
||||
</p>
|
||||
|
||||
<pre><code>% task 1,3-5,12 23-25 done</code></pre>
|
||||
|
||||
<p>
|
||||
This would mark tasks 1, 3, 4, 5, 12, 23, 24 and 25 as done.
|
||||
Note that this example uses two sequences, separated by a space.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Task 1.3.1 fixes this bug, but there is a workaround for users
|
||||
of earlier versions. Add the following line to your ~/.taskrc
|
||||
file:
|
||||
You must be careful though. Task tries very carefully to do
|
||||
the right thing when it interprets the command line, but must
|
||||
still impose some rules so that it can unambiguously read the
|
||||
command. If you use one or more sequences, then they must
|
||||
appear on the command line adjacent to each other. If they
|
||||
are separated by something else, then task assumes the second
|
||||
and subsequent set is not a sequence. Here is an example
|
||||
of this:
|
||||
</p>
|
||||
|
||||
<code><pre>dateformat=m/d/Y</pre></code>
|
||||
|
||||
<p class="small">
|
||||
The "dateformat" setting is supported in task 1.1.0 and later.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<h2 class="title">How do I build task under Cygwin?</h2>
|
||||
<div class="content">
|
||||
<p>
|
||||
Task is built the same way everywhere. But under Cygwin, you'll
|
||||
need to make sure you have the following packages available
|
||||
first:
|
||||
|
||||
<ul>
|
||||
<li>gcc
|
||||
<li>make
|
||||
<li>libncurses-devel
|
||||
<li>libncurses8
|
||||
</ul>
|
||||
|
||||
The gcc and make packages allow you to compile the code, and
|
||||
are therefore required, but the ncurses packages are optional.
|
||||
Ncurses will allow task to determine the width of the window, and
|
||||
therefore use the whole width and wrap text accordingly, for a
|
||||
more aesthetically pleasing display.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<h2 class="title">Do colors work under Cygwin?</h2>
|
||||
<div class="content">
|
||||
<p>
|
||||
They do, but only in a limited way. You can use regular
|
||||
foreground colors (black, red, green ...) and you can
|
||||
regular background colors (on_black, on_red, on_green ...),
|
||||
but underline and bold are not supported.
|
||||
</p>
|
||||
<pre><code>% task 3 Order part number 4-123</code></pre>
|
||||
|
||||
<p>
|
||||
If you run the command:
|
||||
<code><pre>% task colors</pre></code>
|
||||
Task will display all the colors it can use, and you will
|
||||
see which ones you can use.
|
||||
Clearly the 4-123 is a part number, and not a sequence.
|
||||
Task is being asked to modify the description of task 3 to be
|
||||
"Order part number 4-123". Note that the ID is separated
|
||||
from the part number by something other than a sequence.
|
||||
Here is a bad example that task will misinterpret:
|
||||
</p>
|
||||
|
||||
<pre><code>% task 3 4-123 is back-ordered, try again next week</code></pre>
|
||||
|
||||
<p>
|
||||
The intent here is that task 3 have its description modified to be
|
||||
"40123 is back-ordered, try again next week", but will be
|
||||
misinterpreted as tasks 3, 4, 5, 6 ... 123 will all be modified
|
||||
to have the description "is back-ordered, try again next week".
|
||||
The solution is to quote the whole description:
|
||||
</p>
|
||||
|
||||
<pre><code>% task 3 "4-123 is back-ordered, try again next week"</code></pre>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Task Usage</title>
|
||||
<title>Tab Completion</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="task.css" type="text/css" />
|
||||
</head>
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
@@ -32,71 +31,26 @@
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<h2 class="title"><a name="usage">Command Usage<a></h2>
|
||||
<h2 class="title"><a name="simple">Tab Completion</a></h2>
|
||||
<div class="content">
|
||||
<pre><code>Usage: task
|
||||
task add [tags] [attrs] desc...
|
||||
task append [tags] [attrs] desc...
|
||||
task annotate ID desc...
|
||||
task completed [tags] [attrs] desc...
|
||||
task ID [tags] [attrs] [desc...]
|
||||
task ID /from/to/
|
||||
task delete ID
|
||||
task undelete ID
|
||||
task info ID
|
||||
task start ID
|
||||
task stop ID
|
||||
task done ID
|
||||
task undo ID
|
||||
task projects
|
||||
task tags
|
||||
task summary
|
||||
task history
|
||||
task ghistory
|
||||
task next
|
||||
task calendar
|
||||
task active
|
||||
task overdue
|
||||
task stats
|
||||
task export
|
||||
task color
|
||||
task version
|
||||
task help
|
||||
task list [tags] [attrs] desc...
|
||||
task long [tags] [attrs] desc...
|
||||
task ls [tags] [attrs] desc...
|
||||
task newest [tags] [attrs] desc...
|
||||
task oldest [tags] [attrs] desc...
|
||||
<p>
|
||||
There is a Bash tab completion script distributed with task,
|
||||
called task_completion.sh.
|
||||
</p>
|
||||
|
||||
See http://www.beckingham.net/task.html for the latest releases and a full tutorial.
|
||||
<p>
|
||||
To install it, copy it to your
|
||||
|
||||
ID is the numeric identifier displayed by the 'task list' command
|
||||
<code>/etc/bash_completion.d</code>
|
||||
|
||||
Tags are arbitrary words, any quantity:
|
||||
+tag The + means add the tag
|
||||
-tag The - means remove the tag
|
||||
directory (in case you want to have it available system-wide)
|
||||
and then
|
||||
|
||||
Attributes are:
|
||||
project: Project name
|
||||
priority: Priority
|
||||
due: Due date
|
||||
recur: Recurrence frequency
|
||||
until: Recurrence end date
|
||||
fg: Foreground color
|
||||
bg: Background color
|
||||
rc: Alternate .taskrc file
|
||||
<pre><code>source /etc/bash_completion</code></pre>
|
||||
|
||||
Any command or attribute name may be abbreviated if still unique:
|
||||
task list project:Home
|
||||
task li pro:Home
|
||||
|
||||
Some task descriptions need to be escaped because of the shell:
|
||||
task add "quoted ' quote"
|
||||
task add escaped \' quote
|
||||
|
||||
Many characters have special meaning to the shell, including:
|
||||
$ ! ' " ( ) ; \ ` * ? { } [ ] < > | & % # ~</code></pre>
|
||||
<div>
|
||||
or source it from your home directory's bashrc files.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
159
html/task.html
159
html/task.html
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
@@ -50,16 +49,17 @@
|
||||
<li><a href="shell.html">Interacting with the Shell</a>
|
||||
<li><a href="config.html">Configuring Task</a>
|
||||
<li><a href="color.html">Color</a>
|
||||
<li><a href="usage.html">Task Command Usage</a>
|
||||
<li><a href="recur.html">Recurring Tasks</a>
|
||||
<li><a href="date.html">Date Handling</a>
|
||||
<li><a href="troubleshooting.html">Troubleshooting</a>
|
||||
<li><a href="versions.html">Old Versions</a>
|
||||
<li><a href="filter.html">Filters</a>
|
||||
<li><a href="shadow.html">Shadow Files</a>
|
||||
<li><a href="custom.html">Custom Reports</a>
|
||||
<li><a href="import.html">Data Import</a>
|
||||
<li><a href="faq.html">Frequently Asked Questions</a>
|
||||
<li><a href="sequence.html">ID Sequences</a>
|
||||
<li><a href="tab_completion.html">Tab Completion</a>
|
||||
<li><a href="git.html">How to use git and contribute to task</a>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
@@ -72,6 +72,40 @@
|
||||
which illustrates many of task's features.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For the latest news, discussion of proposed task features, and
|
||||
somewhere to voice your opinions, join us at
|
||||
<a href="http://groups.google.com/group/taskprogram">http://groups.google.com/group/taskprogram</a>.
|
||||
|
||||
<table border=0 style="background-color: #fff; padding: 5px;" cellspacing=0>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="http://groups.google.com/groups/img/3nb/groups_bar.gif"
|
||||
height=26 width=132 alt="Google Groups">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 5px">
|
||||
<b>Subscribe to taskprogram</b>
|
||||
</td>
|
||||
</tr>
|
||||
<form action="http://groups.google.com/group/taskprogram/boxsubscribe">
|
||||
<tr>
|
||||
<td style="padding-left: 5px;">
|
||||
Email:
|
||||
<input type=text name=email>
|
||||
<input type=submit name="sub" value="Subscribe">
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
<tr>
|
||||
<td align=right>
|
||||
<a href="http://groups.google.com/group/taskprogram">Visit this group</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<br />
|
||||
<h2 class="title">Get the Latest Stable Release</h2>
|
||||
|
||||
@@ -79,104 +113,78 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>Source:</td>
|
||||
<td><a href="http://www.beckingham.net/task-1.6.0.tar.gz">task-1.6.0.tar.gz</a></td>
|
||||
<td><a href="http://www.beckingham.net/task-1.7.0.tar.gz">task-1.7.0.tar.gz</a></td>
|
||||
</tr>
|
||||
<!--
|
||||
<tr>
|
||||
<td>Mac OS X 10.5 (Leopard) Intel-only:</td>
|
||||
<td><a href="http://www.beckingham.net/task-1.6.0.pkg">task-1.6.0.pkg</a></td>
|
||||
<td><a href="http://www.beckingham.net/task-1.7.0.pkg">task-1.7.0.pkg</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Debian:
|
||||
(Thanks to <a href="http://blog.rfquerin.org">Richard Querin</a>):
|
||||
</td>
|
||||
<td><a href="http://www.beckingham.net/task_1.6.0-1_i386.deb">task_1.6.0-1_i386.deb</a></td>
|
||||
<td><a href="http://www.beckingham.net/task_1.7.0-1_i386.deb">task_1.7.0-1_i386.deb</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Red Hat:
|
||||
(Thanks to <a href="http://www.ultrafredde.com">Federico Hernandez</a>):
|
||||
</td>
|
||||
<td><a href="http://www.beckingham.net/task-1.6.0-1.i386.rpm">task-1.6.0-1.i386.rpm</a></td>
|
||||
<td><a href="http://www.beckingham.net/task-1.7.0-1.FC10.i386.rpm">task-1.7.0-1.FC10.i386.rpm</a></td>
|
||||
</tr>
|
||||
-->
|
||||
<tr>
|
||||
<td>Git - get the whole source and history:</td>
|
||||
<td><a href="http://github.com/pbeckingham/task">http://github.com/pbeckingham/task</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h4>New in version 1.6.0 (?)</h4>
|
||||
<h4>New in version 1.7.0 (5/14/2009)</h4>
|
||||
<ul>
|
||||
<li>Added support for new "append" command that adds more description text to
|
||||
an existing task.
|
||||
<li>Added support for the "weekdays" recurrence, which means a task can recur
|
||||
five times a week, and not on weekends (thanks to Chris Pride).
|
||||
<li>UTF8 text is now supported in task project names, tags and descriptions.
|
||||
<li>Fixed bug that caused the y/n confirmation on task deletion to ignore the
|
||||
Enter key and fail to re-prompt (thanks to Bruce Dillahunty).
|
||||
<li>When the "echo.command" configuration variable is set to "yes", it causes
|
||||
commands that modify tasks to display which task was affected (thanks to
|
||||
Bruce Dillahunty).
|
||||
<li>A task can now be annotated with the command "task <id> annotate ...", and
|
||||
a timestamped annotation will appear in reports.
|
||||
<li>A 'description_only' column is now available for use in custom reports,
|
||||
and it excludes annotations.
|
||||
<li>A task can now be upgraded to a recurring task by adding a recurrence
|
||||
frequency, a due date, and an optional until date.
|
||||
<li>When a recurring task is modified, all other instances of the recurring
|
||||
task are also modified.
|
||||
<li>Custom reports now support user-specified column labels (thanks to T.
|
||||
<li>Improved the errors when parsing a corrupt or unrecognized pending.data
|
||||
or completed.data file (thanks to T. Charles Yun).
|
||||
<li>Added details to the "info" report about recurring tasks (thanks to T.
|
||||
Charles Yun).
|
||||
<li>Task can now import tasks from a variety of data formats, including task
|
||||
export files from versions 1.4.3 and earlier, versions 1.5.0 and later,
|
||||
todo.sh 2.x, CSV, plain text and task command line. See online docs for
|
||||
full details.
|
||||
<li>Export was including 'id' in the column header even though it was not
|
||||
included in the data.
|
||||
<li>The task file format has changed slightly. Please back up your task
|
||||
data files before upgrading to 1.6.0.
|
||||
<li>Added new column 'recurrence_indicator' that displays an 'R' if the task
|
||||
is a recurring task. This column can be added to any custom report.
|
||||
<li>Added new column 'tag_indicator' that displays a '+' if the task
|
||||
has any tags. This column can be added to any custom report.
|
||||
<li>Fixed bug where sometimes a task description was concatenated oddly if
|
||||
there was a colon somewhere in the description.
|
||||
<li>Fixed bug that caused recurring annual tasks to exhibit a creeping due
|
||||
date, because of an assumption of 365 days per year, which failed to
|
||||
consider leap years (thanks to T. Charles Yun).
|
||||
<li>Annotations can now be modified with the substitution commands /from/to/.
|
||||
<li>Substitutions can now be made global with /from/to/g and all occurrences
|
||||
of "from" will be replaced with "to".
|
||||
<li>Now writes a sample "defaultwidth" configuration variable to the default
|
||||
.taskrc file (thanks to T. Charles Yun).
|
||||
<li>Task allows commands that require an ID to now be given a sequence, which
|
||||
is a set of IDs. This allows commands like "task delete 1 2 5-10,12".
|
||||
<li>Fixed bug in the ghistory report, which caused it to only show a new
|
||||
month if a task was added during that month.
|
||||
<li>New command "duplicate" which allows an existing task to be duplicated,
|
||||
and also have modifications applied (thanks to David J Patrick).
|
||||
<li>The "append", and "done" commands now allow modifications to be applied
|
||||
to the task(s) (thanks to David J Patrick).
|
||||
<li>Improved word wrapping in various output.
|
||||
<li>Fixed bug that added an extra line between header and graph in the
|
||||
ghistory report.
|
||||
<li>Added simple 'taskprogram' mailing list subscribe form to the web site.
|
||||
<li>For custom reports that define a "limit" to the number of rows of output
|
||||
such as "oldest" and "newest", task allows an override value. For
|
||||
example "task oldest 5" will display the 5 oldest tasks.
|
||||
<li>Modified the "stats" report so that it has the same aesthetics as the
|
||||
other reports.
|
||||
<li>New "timesheet" command displays tasks completed and started, per week,
|
||||
and can display multiple weeks.
|
||||
<li>New tab completion script, task_completion.sh, for bash users, is installed
|
||||
to /usr/local/share/task (thanks to Federico Hernandez).
|
||||
<li>Applied patch to allow task to build on Arch Linux (thanks to Johan Friis).
|
||||
<li>Applied patch to fix a UUID bug on Solaris 8 (thanks to Steven de Brouwer).
|
||||
<li>The task man page is now installed. Try "man task" (thanks to Federico
|
||||
Hernandez and P.C. Shyamshankar).
|
||||
<li>Fixed bug that causes task to create a default .task directory, even if
|
||||
data.location specified otherwise (thanks to Federico Hernandez).
|
||||
<li>New "edit" command that fires up a text editor (uses 'editor' configuration
|
||||
variable, $VISUAL or $EDITOR environment variable) and allows direct
|
||||
editing of all editable task details.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
(Find out <a href="versions.html">what was new in prior versions</a>)
|
||||
</p>
|
||||
<!--
|
||||
<h2>Task 1.6.0 Beta</h2>
|
||||
<p>
|
||||
The next version of task is in beta. This means it is approaching the
|
||||
end of the current development and testing cycle, and feedback from
|
||||
a wider audience is needed to find the last bugs. If you would like
|
||||
to help test the next release of task, download the beta source below
|
||||
and install in the usual manner.
|
||||
</p>
|
||||
<p>
|
||||
Please note that beta software may contain significant bugs. If you
|
||||
use this beta release, you should first backup your existing task
|
||||
data files.
|
||||
</p>
|
||||
<p>
|
||||
Refer to the ChangeLog file for details regarding the various fixes
|
||||
and enhancements.
|
||||
</p>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Source:</td>
|
||||
<td><a href="http://www.beckingham.net/task-1.6.0beta.tar.gz">task-1.6.0beta.tar.gz</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
-->
|
||||
|
||||
<h2>Troubleshooting</h2>
|
||||
<p>
|
||||
Task has been built from source and tested in the following environments:
|
||||
@@ -192,6 +200,9 @@
|
||||
<li>Ubuntu 7 Feisty Fawn
|
||||
<li>Ubuntu 8 Hardy Heron
|
||||
<li>Ubuntu 8.10 Intrepid Ibex
|
||||
<li>Ubuntu 9.04 Jaunty Jackalope
|
||||
<li>Arch Linux
|
||||
<li>Solaris 8
|
||||
<li>Solaris 10
|
||||
<li>Cygwin 1.5.25-14
|
||||
</ul>
|
||||
@@ -204,7 +215,7 @@
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Take a look at the <a href="troubleshooting.html">troubleshooting guide</a>
|
||||
Take a look at the <a href="faq.html">FAQ</a>
|
||||
for tips and workarounds to problems.
|
||||
</p>
|
||||
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<a href="shell.html">Shell</a>
|
||||
<a href="config.html">Configuration</a>
|
||||
<a href="color.html">Colors</a>
|
||||
<a href="usage.html">Usage</a>
|
||||
<a href="recur.html">Recurrence</a>
|
||||
<a href="date.html">Date Handling</a>
|
||||
<a href="troubleshooting.html">Troubleshooting</a>
|
||||
<a href="faq.html">FAQ</a>
|
||||
<a href="versions.html">Old Versions</a>
|
||||
<a href="links.html">Task on the Web</a>
|
||||
</div>
|
||||
@@ -36,6 +35,121 @@
|
||||
<br />
|
||||
|
||||
<div class="content">
|
||||
<h4>New in version 1.6.1 (4/24/2009)</h4>
|
||||
<p>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Source:</td>
|
||||
<td><a href="http://www.beckingham.net/task-1.6.1.tar.gz">task-1.6.1.tar.gz</a></td>
|
||||
</tr>
|
||||
<!--
|
||||
<tr>
|
||||
<td>Mac OS X 10.5 (Leopard) Intel-only:</td>
|
||||
<td><a href="http://www.beckingham.net/task-1.6.1.pkg">task-1.6.1.pkg</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Debian:
|
||||
(Thanks to <a href="http://blog.rfquerin.org">Richard Querin</a>):
|
||||
</td>
|
||||
<td><a href="http://www.beckingham.net/task_1.6.1-1_i386.deb">task_1.6.1-1_i386.deb</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Red Hat:
|
||||
(Thanks to <a href="http://www.ultrafredde.com">Federico Hernandez</a>):
|
||||
</td>
|
||||
<td><a href="http://www.beckingham.net/task-1.6.1-1.FC10.i386.rpm">task-1.6.1-1.FC10.i386.rpm</a></td>
|
||||
</tr>
|
||||
-->
|
||||
<tr>
|
||||
<td>Git - get the whole source and history:</td>
|
||||
<td><a href="http://github.com/pbeckingham/task">http://github.com/pbeckingham/task</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<ul>
|
||||
<li>Fixed bug that caused new, first-time .taskrc files to be written without
|
||||
including the custom report labels (thanks to P.C. Shyamshankar).
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<h4>New in version 1.6.0 (4/13/2009)</h4>
|
||||
<p>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Source:</td>
|
||||
<td><a href="http://www.beckingham.net/task-1.6.0.tar.gz">task-1.6.0.tar.gz</a></td>
|
||||
</tr>
|
||||
<!--
|
||||
<tr>
|
||||
<td>Mac OS X 10.5 (Leopard) Intel-only:</td>
|
||||
<td><a href="http://www.beckingham.net/task-1.6.0.pkg">task-1.6.0.pkg</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Debian:
|
||||
(Thanks to <a href="http://blog.rfquerin.org">Richard Querin</a>):
|
||||
</td>
|
||||
<td><a href="http://www.beckingham.net/task_1.6.0-1_i386.deb">task_1.6.0-1_i386.deb</a></td>
|
||||
</tr>
|
||||
-->
|
||||
<tr>
|
||||
<td>
|
||||
Red Hat:
|
||||
(Thanks to <a href="http://www.ultrafredde.com">Federico Hernandez</a>):
|
||||
</td>
|
||||
<td><a href="http://www.beckingham.net/task-1.6.0-1.FC10.i386.rpm">task-1.6.0-1.FC10.i386.rpm</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Git - get the whole source and history:</td>
|
||||
<td><a href="http://github.com/pbeckingham/task">http://github.com/pbeckingham/task</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<ul>
|
||||
<li>Added support for new "append" command that adds more description text to
|
||||
an existing task.
|
||||
<li>Added support for the "weekdays" recurrence, which means a task can recur
|
||||
five times a week, and not on weekends (thanks to Chris Pride).
|
||||
<li>UTF8 text is now supported in task project names, tags and descriptions.
|
||||
<li>Fixed bug that caused the y/n confirmation on task deletion to ignore the
|
||||
Enter key and fail to re-prompt (thanks to Bruce Dillahunty).
|
||||
<li>When the "echo.command" configuration variable is set to "yes", it causes
|
||||
commands that modify tasks to display which task was affected (thanks to
|
||||
Bruce Dillahunty).
|
||||
<li>A task can now be annotated with the command "task <id> annotate ...", and
|
||||
a timestamped annotation will appear in reports.
|
||||
<li>A 'description_only' column is now available for use in custom reports,
|
||||
and it excludes annotations.
|
||||
<li>A task can now be upgraded to a recurring task by adding a recurrence
|
||||
frequency, a due date, and an optional until date.
|
||||
<li>When a recurring task is modified, all other instances of the recurring
|
||||
task are also modified.
|
||||
<li>Custom reports now support user-specified column labels (thanks to T.
|
||||
Charles Yun).
|
||||
<li>Task can now import tasks from a variety of data formats, including task
|
||||
export files from versions 1.4.3 and earlier, versions 1.5.0 and later,
|
||||
todo.sh 2.x, CSV, plain text and task command line. See online docs for
|
||||
full details.
|
||||
<li>Export was including 'id' in the column header even though it was not
|
||||
included in the data.
|
||||
<li>The task file format has changed slightly. Please back up your task
|
||||
data files before upgrading to 1.6.0.
|
||||
<li>Added new column 'recurrence_indicator' that displays an 'R' if the task
|
||||
is a recurring task. This column can be added to any custom report.
|
||||
<li>Added new column 'tag_indicator' that displays a '+' if the task
|
||||
has any tags. This column can be added to any custom report.
|
||||
<li>Fixed bug where sometimes a task description was concatenated oddly if
|
||||
there was a colon somewhere in the description.
|
||||
<li>Fixed bug that caused recurring annual tasks to exhibit a creeping due
|
||||
date, because of an assumption of 365 days per year, which failed to
|
||||
consider leap years (thanks to T. Charles Yun).
|
||||
<li>Annotations can now be modified with the substitution commands /from/to/.
|
||||
<li>Substitutions can now be made global with /from/to/g and all occurrences
|
||||
of "from" will be replaced with "to".
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<h4>New in version 1.5.0 (3/15/2009)</h4>
|
||||
|
||||
@@ -149,11 +149,13 @@ void Config::createDefault (const std::string& home)
|
||||
fprintf (out, "next=2\n");
|
||||
fprintf (out, "dateformat=m/d/Y\n");
|
||||
fprintf (out, "#monthsperline=2\n");
|
||||
fprintf (out, "#defaultwidth=80\n");
|
||||
fprintf (out, "curses=on\n");
|
||||
fprintf (out, "color=on\n");
|
||||
fprintf (out, "due=7\n");
|
||||
fprintf (out, "nag=You have higher priority tasks.\n");
|
||||
fprintf (out, "locking=on\n");
|
||||
fprintf (out, "#editor=vi\n");
|
||||
|
||||
fprintf (out, "color.overdue=bold_red\n");
|
||||
fprintf (out, "color.due=bold_yellow\n");
|
||||
@@ -183,23 +185,28 @@ void Config::createDefault (const std::string& home)
|
||||
fprintf (out, "# Limit: 10\n");
|
||||
|
||||
fprintf (out, "report.long.description=Lists all task, all data, matching the specified criteria\n");
|
||||
fprintf (out, "report.long.labels=ID,Project,Pri,Added,Started,Due,Recur,Age,Tags,Description\n");
|
||||
fprintf (out, "report.long.columns=id,project,priority,entry,start,due,recur,age,tags,description\n");
|
||||
fprintf (out, "report.long.sort=due+,priority-,project+\n");
|
||||
|
||||
fprintf (out, "report.list.description=Lists all tasks matching the specified criteria\n");
|
||||
fprintf (out, "report.list.labels=ID,Project,Pri,Due,Active,Age,Description\n");
|
||||
fprintf (out, "report.list.columns=id,project,priority,due,active,age,description\n");
|
||||
fprintf (out, "report.list.sort=due+,priority-,project+\n");
|
||||
|
||||
fprintf (out, "report.ls.description=Minimal listing of all tasks matching the specified criteria\n");
|
||||
fprintf (out, "report.ls.labels=ID,Project,Pri,Description\n");
|
||||
fprintf (out, "report.ls.columns=id,project,priority,description\n");
|
||||
fprintf (out, "report.ls.sort=priority-,project+\n");
|
||||
|
||||
fprintf (out, "report.newest.description=Shows the newest tasks\n");
|
||||
fprintf (out, "report.newest.labels=ID,Project,Pri,Due,Active,Age,Description\n");
|
||||
fprintf (out, "report.newest.columns=id,project,priority,due,active,age,description\n");
|
||||
fprintf (out, "report.newest.sort=id-\n");
|
||||
fprintf (out, "report.newest.limit=10\n");
|
||||
|
||||
fprintf (out, "report.oldest.description=Shows the oldest tasks\n");
|
||||
fprintf (out, "report.oldest.labels=ID,Project,Pri,Due,Active,Age,Description\n");
|
||||
fprintf (out, "report.oldest.columns=id,project,priority,due,active,age,description\n");
|
||||
fprintf (out, "report.oldest.sort=id+\n");
|
||||
fprintf (out, "report.oldest.limit=10\n");
|
||||
@@ -213,6 +220,9 @@ void Config::createDefault (const std::string& home)
|
||||
|
||||
this->load (rcFile);
|
||||
|
||||
// Get the data.location value from the (potentially newly created) .taskrc
|
||||
// file.
|
||||
dataDir = this->get ("data.location", dataDir);
|
||||
if (-1 == access (dataDir.c_str (), F_OK))
|
||||
mkdir (dataDir.c_str (), S_IRWXU);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#ifndef INCLUDED_DATE
|
||||
#define INCLUDED_DATE
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
|
||||
class Date;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#ifndef INCLUDED_GRID
|
||||
#define INCLUDED_GRID
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
bin_PROGRAMS = task
|
||||
task_SOURCES = Config.cpp Date.cpp T.cpp TDB.cpp Table.cpp Grid.cpp Timer.cpp color.cpp parse.cpp task.cpp command.cpp report.cpp util.cpp text.cpp rules.cpp import.cpp Config.h Date.h T.h TDB.h Table.h Grid.h Timer.h color.h task.h
|
||||
task_SOURCES = Config.cpp Date.cpp T.cpp TDB.cpp Table.cpp Grid.cpp Timer.cpp color.cpp parse.cpp task.cpp command.cpp edit.cpp report.cpp util.cpp text.cpp rules.cpp import.cpp Config.h Date.h T.h TDB.h Table.h Grid.h Timer.h color.h task.h
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -46,11 +46,11 @@ PROGRAMS = $(bin_PROGRAMS)
|
||||
am_task_OBJECTS = Config.$(OBJEXT) Date.$(OBJEXT) T.$(OBJEXT) \
|
||||
TDB.$(OBJEXT) Table.$(OBJEXT) Grid.$(OBJEXT) Timer.$(OBJEXT) \
|
||||
color.$(OBJEXT) parse.$(OBJEXT) task.$(OBJEXT) \
|
||||
command.$(OBJEXT) report.$(OBJEXT) util.$(OBJEXT) \
|
||||
text.$(OBJEXT) rules.$(OBJEXT) import.$(OBJEXT)
|
||||
command.$(OBJEXT) edit.$(OBJEXT) report.$(OBJEXT) \
|
||||
util.$(OBJEXT) text.$(OBJEXT) rules.$(OBJEXT) import.$(OBJEXT)
|
||||
task_OBJECTS = $(am_task_OBJECTS)
|
||||
task_LDADD = $(LDADD)
|
||||
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
@@ -153,9 +153,10 @@ sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
task_SOURCES = Config.cpp Date.cpp T.cpp TDB.cpp Table.cpp Grid.cpp Timer.cpp color.cpp parse.cpp task.cpp command.cpp report.cpp util.cpp text.cpp rules.cpp import.cpp Config.h Date.h T.h TDB.h Table.h Grid.h Timer.h color.h task.h
|
||||
task_SOURCES = Config.cpp Date.cpp T.cpp TDB.cpp Table.cpp Grid.cpp Timer.cpp color.cpp parse.cpp task.cpp command.cpp edit.cpp report.cpp util.cpp text.cpp rules.cpp import.cpp Config.h Date.h T.h TDB.h Table.h Grid.h Timer.h color.h task.h
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -231,6 +232,7 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Timer.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/color.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/command.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edit.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/import.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/report.Po@am__quote@
|
||||
@@ -258,8 +260,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
@@ -271,8 +273,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
@@ -282,13 +284,12 @@ ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
22
src/T.cpp
22
src/T.cpp
@@ -37,6 +37,7 @@ T::T ()
|
||||
mUUID = uuid ();
|
||||
mStatus = pending;
|
||||
mId = 0;
|
||||
mSequence.clear ();
|
||||
mTags.clear ();
|
||||
mAttributes.clear ();
|
||||
mDescription = "";
|
||||
@@ -59,6 +60,7 @@ T::T (const T& other)
|
||||
mStatus = other.mStatus;
|
||||
mUUID = other.mUUID;
|
||||
mId = other.mId;
|
||||
mSequence = other.mSequence;
|
||||
mDescription = other.mDescription;
|
||||
mTags = other.mTags;
|
||||
mRemoveTags = other.mRemoveTags;
|
||||
@@ -74,6 +76,7 @@ T& T::operator= (const T& other)
|
||||
mStatus = other.mStatus;
|
||||
mUUID = other.mUUID;
|
||||
mId = other.mId;
|
||||
mSequence = other.mSequence;
|
||||
mDescription = other.mDescription;
|
||||
mTags = other.mTags;
|
||||
mRemoveTags = other.mRemoveTags;
|
||||
@@ -286,6 +289,16 @@ void T::addAnnotation (const std::string& description)
|
||||
mAnnotations[time (NULL)] = sanitized;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool T::sequenceContains (int id) const
|
||||
{
|
||||
foreach (seq, mSequence)
|
||||
if (*seq == id)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// uuid status [tags] [attributes] [annotations] description
|
||||
//
|
||||
@@ -575,6 +588,7 @@ void T::parse (const std::string& line)
|
||||
openAttrBracket + 1, closeAttrBracket - openAttrBracket - 1);
|
||||
std::vector <std::string> pairs;
|
||||
split (pairs, attributes, ' ');
|
||||
|
||||
for (size_t i = 0; i < pairs.size (); ++i)
|
||||
{
|
||||
std::vector <std::string> pair;
|
||||
@@ -623,15 +637,17 @@ void T::parse (const std::string& line)
|
||||
|
||||
mDescription = line.substr (closeAnnoBracket + 2, std::string::npos);
|
||||
}
|
||||
else
|
||||
throw std::string ("Missing annotation brackets.");
|
||||
}
|
||||
else
|
||||
throw std::string ("Missing attribute brackets");
|
||||
throw std::string ("Missing attribute brackets.");
|
||||
}
|
||||
else
|
||||
throw std::string ("Missing tag brackets");
|
||||
throw std::string ("Missing tag brackets.");
|
||||
}
|
||||
else
|
||||
throw std::string ("Line too short");
|
||||
throw std::string ("Line too short.");
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
6
src/T.h
6
src/T.h
@@ -49,7 +49,9 @@ public:
|
||||
void setUUID (const std::string& uuid) { mUUID = uuid; }
|
||||
|
||||
int getId () const { return mId; }
|
||||
void setId (int id) { mId = id; }
|
||||
void setId (int id) { mId = id; mSequence.push_back (id); }
|
||||
std::vector <int> getAllIds () const { return mSequence; }
|
||||
void addId (int id) { if (mId == 0) mId = id; mSequence.push_back (id); }
|
||||
|
||||
status getStatus () const { return mStatus; }
|
||||
void setStatus (status s) { mStatus = s; }
|
||||
@@ -82,6 +84,7 @@ public:
|
||||
void getAnnotations (std::map <time_t, std::string>&) const;
|
||||
void setAnnotations (const std::map <time_t, std::string>&);
|
||||
void addAnnotation (const std::string&);
|
||||
bool sequenceContains (int) const;
|
||||
|
||||
const std::string compose () const;
|
||||
const std::string composeCSV ();
|
||||
@@ -95,6 +98,7 @@ private:
|
||||
status mStatus;
|
||||
std::string mUUID;
|
||||
int mId;
|
||||
std::vector <int> mSequence;
|
||||
std::string mDescription;
|
||||
std::vector<std::string> mTags;
|
||||
std::vector<std::string> mRemoveTags;
|
||||
|
||||
129
src/TDB.cpp
129
src/TDB.cpp
@@ -26,6 +26,7 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <sys/file.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
@@ -104,13 +105,27 @@ bool TDB::pendingT (std::vector <T>& all)
|
||||
{
|
||||
mId = 1;
|
||||
|
||||
int line = 1;
|
||||
std::vector <std::string>::iterator it;
|
||||
for (it = lines.begin (); it != lines.end (); ++it)
|
||||
{
|
||||
T t (*it);
|
||||
t.setId (mId++);
|
||||
if (t.getStatus () == T::pending)
|
||||
all.push_back (t);
|
||||
try
|
||||
{
|
||||
T t (*it);
|
||||
t.setId (mId++);
|
||||
if (t.getStatus () == T::pending)
|
||||
all.push_back (t);
|
||||
}
|
||||
|
||||
catch (std::string& e)
|
||||
{
|
||||
std::stringstream more;
|
||||
more << " Line " << line << ", in " << "pending.data";
|
||||
|
||||
throw e + more.str ();
|
||||
}
|
||||
|
||||
++line;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -130,12 +145,26 @@ bool TDB::allPendingT (std::vector <T>& all)
|
||||
{
|
||||
mId = 1;
|
||||
|
||||
int line = 1;
|
||||
std::vector <std::string>::iterator it;
|
||||
for (it = lines.begin (); it != lines.end (); ++it)
|
||||
{
|
||||
T t (*it);
|
||||
t.setId (mId++);
|
||||
all.push_back (t);
|
||||
try
|
||||
{
|
||||
T t (*it);
|
||||
t.setId (mId++);
|
||||
all.push_back (t);
|
||||
}
|
||||
|
||||
catch (std::string& e)
|
||||
{
|
||||
std::stringstream more;
|
||||
more << " Line " << line << ", in " << "pending.data";
|
||||
|
||||
throw e + more.str ();
|
||||
}
|
||||
|
||||
++line;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -152,12 +181,26 @@ bool TDB::completedT (std::vector <T>& all) const
|
||||
std::vector <std::string> lines;
|
||||
if (readLockedFile (mCompletedFile, lines))
|
||||
{
|
||||
int line = 1;
|
||||
std::vector <std::string>::iterator it;
|
||||
for (it = lines.begin (); it != lines.end (); ++it)
|
||||
{
|
||||
T t (*it);
|
||||
if (t.getStatus () != T::deleted)
|
||||
all.push_back (t);
|
||||
try
|
||||
{
|
||||
T t (*it);
|
||||
if (t.getStatus () != T::deleted)
|
||||
all.push_back (t);
|
||||
}
|
||||
|
||||
catch (std::string& e)
|
||||
{
|
||||
std::stringstream more;
|
||||
more << " Line " << line << ", in " << "pending.data";
|
||||
|
||||
throw e + more.str ();
|
||||
}
|
||||
|
||||
++line;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -174,11 +217,25 @@ bool TDB::allCompletedT (std::vector <T>& all) const
|
||||
std::vector <std::string> lines;
|
||||
if (readLockedFile (mCompletedFile, lines))
|
||||
{
|
||||
int line = 1;
|
||||
std::vector <std::string>::iterator it;
|
||||
for (it = lines.begin (); it != lines.end (); ++it)
|
||||
{
|
||||
T t (*it);
|
||||
all.push_back (t);
|
||||
try
|
||||
{
|
||||
T t (*it);
|
||||
all.push_back (t);
|
||||
}
|
||||
|
||||
catch (std::string& e)
|
||||
{
|
||||
std::stringstream more;
|
||||
more << " Line " << line << ", in " << "pending.data";
|
||||
|
||||
throw e + more.str ();
|
||||
}
|
||||
|
||||
++line;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -187,54 +244,6 @@ bool TDB::allCompletedT (std::vector <T>& all) const
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool TDB::deleteT (const T& t)
|
||||
{
|
||||
T task (t);
|
||||
|
||||
std::vector <T> all;
|
||||
allPendingT (all);
|
||||
|
||||
std::vector <T>::iterator it;
|
||||
for (it = all.begin (); it != all.end (); ++it)
|
||||
if (task.getId () == it->getId ())
|
||||
{
|
||||
it->setStatus (T::deleted);
|
||||
|
||||
char endTime[16];
|
||||
sprintf (endTime, "%u", (unsigned int) time (NULL));
|
||||
it->setAttribute ("end", endTime);
|
||||
|
||||
return overwritePending (all);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool TDB::completeT (const T& t)
|
||||
{
|
||||
T task (t);
|
||||
|
||||
std::vector <T> all;
|
||||
allPendingT (all);
|
||||
|
||||
std::vector <T>::iterator it;
|
||||
for (it = all.begin (); it != all.end (); ++it)
|
||||
if (task.getId () == it->getId ())
|
||||
{
|
||||
it->setStatus (T::completed);
|
||||
|
||||
char endTime[16];
|
||||
sprintf (endTime, "%u", (unsigned int) time (NULL));
|
||||
it->setAttribute ("end", endTime);
|
||||
|
||||
return overwritePending (all);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool TDB::addT (const T& t)
|
||||
{
|
||||
|
||||
@@ -43,11 +43,8 @@ public:
|
||||
bool allPendingT (std::vector <T>&);
|
||||
bool completedT (std::vector <T>&) const;
|
||||
bool allCompletedT (std::vector <T>&) const;
|
||||
bool deleteT (const T&);
|
||||
bool completeT (const T&);
|
||||
bool addT (const T&);
|
||||
bool modifyT (const T&);
|
||||
bool logRead (std::vector <std::string>&) const;
|
||||
int gc ();
|
||||
int nextId ();
|
||||
|
||||
|
||||
@@ -803,6 +803,27 @@ void Table::optimize (std::string& output) const
|
||||
Much better.
|
||||
*/
|
||||
|
||||
char patterns[5][16] =
|
||||
{
|
||||
" \n",
|
||||
" \n",
|
||||
" \n",
|
||||
" \n",
|
||||
};
|
||||
|
||||
std::string::size_type trailing;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
do
|
||||
{
|
||||
trailing = output.find (patterns[i]);
|
||||
if (trailing != std::string::npos)
|
||||
output.replace (trailing, strlen (patterns[i]), "\n");
|
||||
}
|
||||
while (trailing != std::string::npos);
|
||||
}
|
||||
|
||||
// std::cout << int ((100 * (start - output.length ()) / start))
|
||||
// << "%" << std::endl;
|
||||
}
|
||||
@@ -1103,6 +1124,7 @@ const std::string Table::render (int maximum /* = 0 */)
|
||||
}
|
||||
}
|
||||
|
||||
optimize (output);
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
886
src/command.cpp
886
src/command.cpp
File diff suppressed because it is too large
Load Diff
588
src/edit.cpp
Normal file
588
src/edit.cpp
Normal file
@@ -0,0 +1,588 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// task - a command line task list manager.
|
||||
//
|
||||
// Copyright 2006 - 2009, Paul Beckingham.
|
||||
// All rights reserved.
|
||||
//
|
||||
// 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 the Free Software
|
||||
// Foundation; either version 2 of the License, or (at your option) any later
|
||||
// version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
// details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with
|
||||
// this program; if not, write to the
|
||||
//
|
||||
// Free Software Foundation, Inc.,
|
||||
// 51 Franklin Street, Fifth Floor,
|
||||
// Boston, MA
|
||||
// 02110-1301
|
||||
// USA
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
#include "task.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static std::string findValue (
|
||||
const std::string& text,
|
||||
const std::string& name)
|
||||
{
|
||||
std::string::size_type found = text.find (name);
|
||||
if (found != std::string::npos)
|
||||
{
|
||||
std::string::size_type eol = text.find ("\n", found);
|
||||
if (eol != std::string::npos)
|
||||
{
|
||||
std::string value = text.substr (
|
||||
found + name.length (),
|
||||
eol - (found + name.length ()));
|
||||
|
||||
return trim (value, "\t ");
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static std::string findDate (
|
||||
Config& conf,
|
||||
const std::string& text,
|
||||
const std::string& name)
|
||||
{
|
||||
std::string::size_type found = text.find (name);
|
||||
if (found != std::string::npos)
|
||||
{
|
||||
std::string::size_type eol = text.find ("\n", found);
|
||||
if (eol != std::string::npos)
|
||||
{
|
||||
std::string value = trim (text.substr (
|
||||
found + name.length (),
|
||||
eol - (found + name.length ())), "\t ");
|
||||
|
||||
if (value != "")
|
||||
{
|
||||
Date dt (value, conf.get ("dateformat", "m/d/Y"));
|
||||
char epoch [16];
|
||||
sprintf (epoch, "%d", (int)dt.toEpoch ());
|
||||
return std::string (epoch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static std::string formatStatus (T& task)
|
||||
{
|
||||
switch (task.getStatus ())
|
||||
{
|
||||
case T::pending: return "Pending"; break;
|
||||
case T::completed: return "Completed"; break;
|
||||
case T::deleted: return "Deleted"; break;
|
||||
case T::recurring: return "Recurring"; break;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static std::string formatDate (
|
||||
Config& conf,
|
||||
T& task,
|
||||
const std::string& attribute)
|
||||
{
|
||||
std::string value = task.getAttribute (attribute);
|
||||
if (value.length ())
|
||||
{
|
||||
Date dt (::atoi (value.c_str ()));
|
||||
value = dt.toString (conf.get ("dateformat", "m/d/Y"));
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static std::string formatTask (Config& conf, T task)
|
||||
{
|
||||
std::stringstream before;
|
||||
before << "# The 'task edit <id>' command allows you to modify all aspects of a task" << std::endl
|
||||
<< "# using a text editor. What is shown below is a representation of the" << std::endl
|
||||
<< "# task in all it's detail. Modify what you wish, and if you save and" << std::endl
|
||||
<< "# quit your editor, task will read this file and try to make sense of" << std::endl
|
||||
<< "# what changed, and apply those changes. If you quit your editor without" << std::endl
|
||||
<< "# saving or making any modifications, task will do nothing." << std::endl
|
||||
<< "#" << std::endl
|
||||
<< "# Lines that begin with # represent data you cannot change, like ID." << std::endl
|
||||
<< "# If you get too 'creative' with your editing, task will dump you back " << std::endl
|
||||
<< "# into the editor to try again." << std::endl
|
||||
<< "#" << std::endl
|
||||
<< "# Should you find yourself in an endless Groundhog Day loop, editing and" << std::endl
|
||||
<< "# editing the same file, just quit the editor without making any changes." << std::endl
|
||||
<< "# Task will notice this and stop the editing." << std::endl
|
||||
<< "#" << std::endl
|
||||
<< "# Name Editable details" << std::endl
|
||||
<< "# ----------------- ----------------------------------------------------" << std::endl
|
||||
<< "# ID: " << task.getId () << std::endl
|
||||
<< "# UUID: " << task.getUUID () << std::endl
|
||||
<< "# Status: " << formatStatus (task) << std::endl
|
||||
<< "# Mask: " << task.getAttribute ("mask") << std::endl
|
||||
<< "# iMask: " << task.getAttribute ("imask") << std::endl
|
||||
<< " Project: " << task.getAttribute ("project") << std::endl
|
||||
<< " Priority: " << task.getAttribute ("priority") << std::endl;
|
||||
|
||||
std::vector <std::string> tags;
|
||||
task.getTags (tags);
|
||||
std::string allTags;
|
||||
join (allTags, " ", tags);
|
||||
before << "# Separate the tags with spaces, like this: tag1 tag2" << std::endl
|
||||
<< " Tags: " << allTags << std::endl
|
||||
<< "# The description field is allowed to wrap and use multiple lines. Task" << std::endl
|
||||
<< "# will combine them." << std::endl
|
||||
<< " Description: " << task.getDescription () << std::endl
|
||||
<< " Created: " << formatDate (conf, task, "entry") << std::endl
|
||||
<< " Started: " << formatDate (conf, task, "start") << std::endl
|
||||
<< " Ended: " << formatDate (conf, task, "end") << std::endl
|
||||
<< " Due: " << formatDate (conf, task, "due") << std::endl
|
||||
<< " Until: " << formatDate (conf, task, "until") << std::endl
|
||||
<< " Recur: " << task.getAttribute ("recur") << std::endl
|
||||
<< " Parent: " << task.getAttribute ("parent") << std::endl
|
||||
<< " Foreground color: " << task.getAttribute ("fg") << std::endl
|
||||
<< " Background color: " << task.getAttribute ("bg") << std::endl
|
||||
<< "# Annotations look like this: <date> <text>, and there can be any number" << std::endl
|
||||
<< "# of them." << std::endl;
|
||||
|
||||
std::map <time_t, std::string> annotations;
|
||||
task.getAnnotations (annotations);
|
||||
foreach (anno, annotations)
|
||||
{
|
||||
Date dt (anno->first);
|
||||
before << " Annotation: " << dt.toString (conf.get ("dateformat", "m/d/Y"))
|
||||
<< " " << anno->second << std::endl;
|
||||
}
|
||||
|
||||
before << " Annotation: " << std::endl
|
||||
<< " Annotation: " << std::endl
|
||||
<< "# End" << std::endl;
|
||||
return before.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static void parseTask (Config& conf, T& task, const std::string& after)
|
||||
{
|
||||
// project
|
||||
std::string value = findValue (after, "Project:");
|
||||
if (task.getAttribute ("project") != value)
|
||||
{
|
||||
if (value != "")
|
||||
{
|
||||
std::cout << "Project modified." << std::endl;
|
||||
task.setAttribute ("project", value);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Project deleted." << std::endl;
|
||||
task.removeAttribute ("project");
|
||||
}
|
||||
}
|
||||
|
||||
// priority
|
||||
value = findValue (after, "Priority:");
|
||||
if (task.getAttribute ("priority") != value)
|
||||
{
|
||||
if (value != "")
|
||||
{
|
||||
if (validPriority (value))
|
||||
{
|
||||
std::cout << "Priority modified." << std::endl;
|
||||
task.setAttribute ("priority", value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Priority deleted." << std::endl;
|
||||
task.removeAttribute ("priority");
|
||||
}
|
||||
}
|
||||
|
||||
// tags
|
||||
value = findValue (after, "Tags:");
|
||||
std::vector <std::string> tags;
|
||||
split (tags, value, ' ');
|
||||
task.removeTags ();
|
||||
task.addTags (tags);
|
||||
|
||||
// description.
|
||||
value = findValue (after, "Description: ");
|
||||
if (task.getDescription () != value)
|
||||
{
|
||||
if (value != "")
|
||||
{
|
||||
std::cout << "Description modified." << std::endl;
|
||||
task.setDescription (value);
|
||||
}
|
||||
else
|
||||
throw std::string ("Cannot remove description.");
|
||||
}
|
||||
|
||||
// entry
|
||||
value = findDate (conf, after, "Created:");
|
||||
if (value != "")
|
||||
{
|
||||
Date edited (::atoi (value.c_str ()));
|
||||
|
||||
Date original (::atoi (task.getAttribute ("entry").c_str ()));
|
||||
if (!original.sameDay (edited))
|
||||
{
|
||||
std::cout << "Creation date modified." << std::endl;
|
||||
task.setAttribute ("entry", value);
|
||||
}
|
||||
}
|
||||
else
|
||||
throw std::string ("Cannot remove creation date");
|
||||
|
||||
// start
|
||||
value = findDate (conf, after, "Started:");
|
||||
if (value != "")
|
||||
{
|
||||
Date edited (::atoi (value.c_str ()));
|
||||
|
||||
if (task.getAttribute ("start") != "")
|
||||
{
|
||||
Date original (::atoi (task.getAttribute ("start").c_str ()));
|
||||
if (!original.sameDay (edited))
|
||||
{
|
||||
std::cout << "Start date modified." << std::endl;
|
||||
task.setAttribute ("start", value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Start date modified." << std::endl;
|
||||
task.setAttribute ("start", value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (task.getAttribute ("start") != "")
|
||||
{
|
||||
std::cout << "Start date removed." << std::endl;
|
||||
task.removeAttribute ("start");
|
||||
}
|
||||
}
|
||||
|
||||
// end
|
||||
value = findDate (conf, after, "Ended:");
|
||||
if (value != "")
|
||||
{
|
||||
Date edited (::atoi (value.c_str ()));
|
||||
|
||||
if (task.getAttribute ("end") != "")
|
||||
{
|
||||
Date original (::atoi (task.getAttribute ("end").c_str ()));
|
||||
if (!original.sameDay (edited))
|
||||
{
|
||||
std::cout << "Done date modified." << std::endl;
|
||||
task.setAttribute ("end", value);
|
||||
}
|
||||
}
|
||||
else if (task.getStatus () != T::deleted)
|
||||
throw std::string ("Cannot set a done date on a pending task.");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (task.getAttribute ("end") != "")
|
||||
{
|
||||
std::cout << "Done date removed." << std::endl;
|
||||
task.setStatus (T::pending);
|
||||
task.removeAttribute ("end");
|
||||
}
|
||||
}
|
||||
|
||||
// due
|
||||
value = findDate (conf, after, "Due:");
|
||||
if (value != "")
|
||||
{
|
||||
Date edited (::atoi (value.c_str ()));
|
||||
|
||||
if (task.getAttribute ("due") != "")
|
||||
{
|
||||
Date original (::atoi (task.getAttribute ("due").c_str ()));
|
||||
if (!original.sameDay (edited))
|
||||
{
|
||||
std::cout << "Due date modified." << std::endl;
|
||||
task.setAttribute ("due", value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Due date modified." << std::endl;
|
||||
task.setAttribute ("due", value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (task.getAttribute ("due") != "")
|
||||
{
|
||||
if (task.getStatus () == T::recurring ||
|
||||
task.getAttribute ("parent") != "")
|
||||
{
|
||||
std::cout << "Cannot remove a due date from a recurring task." << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Due date removed." << std::endl;
|
||||
task.removeAttribute ("due");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// until
|
||||
value = findDate (conf, after, "Until:");
|
||||
if (value != "")
|
||||
{
|
||||
Date edited (::atoi (value.c_str ()));
|
||||
|
||||
if (task.getAttribute ("until") != "")
|
||||
{
|
||||
Date original (::atoi (task.getAttribute ("until").c_str ()));
|
||||
if (!original.sameDay (edited))
|
||||
{
|
||||
std::cout << "Until date modified." << std::endl;
|
||||
task.setAttribute ("until", value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Until date modified." << std::endl;
|
||||
task.setAttribute ("until", value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (task.getAttribute ("until") != "")
|
||||
{
|
||||
std::cout << "Until date removed." << std::endl;
|
||||
task.removeAttribute ("until");
|
||||
}
|
||||
}
|
||||
|
||||
// recur
|
||||
value = findValue (after, "Recur:");
|
||||
if (value != task.getAttribute ("recur"))
|
||||
{
|
||||
if (value != "")
|
||||
{
|
||||
if (validDuration (value))
|
||||
{
|
||||
std::cout << "Recurrence modified." << std::endl;
|
||||
if (task.getAttribute ("due") != "")
|
||||
{
|
||||
task.setAttribute ("recur", value);
|
||||
task.setStatus (T::recurring);
|
||||
}
|
||||
else
|
||||
throw std::string ("A recurring task must have a due date.");
|
||||
}
|
||||
else
|
||||
throw std::string ("Not a valid recurrence duration.");
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Recurrence removed." << std::endl;
|
||||
task.setStatus (T::pending);
|
||||
task.removeAttribute ("recur");
|
||||
task.removeAttribute ("until");
|
||||
task.removeAttribute ("mask");
|
||||
task.removeAttribute ("imask");
|
||||
}
|
||||
}
|
||||
|
||||
// parent
|
||||
value = findValue (after, "Parent:");
|
||||
if (value != task.getAttribute ("parent"))
|
||||
{
|
||||
if (value != "")
|
||||
{
|
||||
std::cout << "Parent UUID modified." << std::endl;
|
||||
task.setAttribute ("parent", value);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Parent UUID removed." << std::endl;
|
||||
task.removeAttribute ("parent");
|
||||
}
|
||||
}
|
||||
|
||||
// fg
|
||||
value = findValue (after, "Foreground color:");
|
||||
if (value != task.getAttribute ("fg"))
|
||||
{
|
||||
if (value != "")
|
||||
{
|
||||
std::cout << "Foreground color modified." << std::endl;
|
||||
task.setAttribute ("fg", value);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Foreground color removed." << std::endl;
|
||||
task.removeAttribute ("fg");
|
||||
}
|
||||
}
|
||||
|
||||
// bg
|
||||
value = findValue (after, "Background color:");
|
||||
if (value != task.getAttribute ("bg"))
|
||||
{
|
||||
if (value != "")
|
||||
{
|
||||
std::cout << "Background color modified." << std::endl;
|
||||
task.setAttribute ("bg", value);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Background color removed." << std::endl;
|
||||
task.removeAttribute ("bg");
|
||||
}
|
||||
}
|
||||
|
||||
// Annotations
|
||||
std::map <time_t, std::string> annotations;
|
||||
std::string::size_type found = 0;
|
||||
while ((found = after.find ("Annotation:", found)) != std::string::npos)
|
||||
{
|
||||
found += 11;
|
||||
|
||||
std::string::size_type eol = after.find ("\n", found);
|
||||
if (eol != std::string::npos)
|
||||
{
|
||||
std::string value = trim (after.substr (
|
||||
found,
|
||||
eol - found), "\t ");
|
||||
|
||||
std::string::size_type gap = value.find (" ");
|
||||
if (gap != std::string::npos)
|
||||
{
|
||||
Date when (value.substr (0, gap));
|
||||
std::string text = trim (value.substr (gap, std::string::npos), "\t ");
|
||||
annotations[when.toEpoch ()] = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task.setAnnotations (annotations);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Introducing the Silver Bullet. This feature is the catch-all fixative for
|
||||
// various other ills. This is like opening up the hood and going in with a
|
||||
// wrench. To be used sparingly.
|
||||
std::string handleEdit (TDB& tdb, T& task, Config& conf)
|
||||
{
|
||||
std::stringstream out;
|
||||
std::vector <T> all;
|
||||
tdb.allPendingT (all);
|
||||
|
||||
filterSequence (all, task);
|
||||
foreach (seq, all)
|
||||
{
|
||||
// Check for file permissions.
|
||||
std::string dataLocation = expandPath (conf.get ("data.location"));
|
||||
if (access (dataLocation.c_str (), X_OK))
|
||||
throw std::string ("Your data.location directory is not writable.");
|
||||
|
||||
// Create a temp file name in data.location.
|
||||
std::stringstream pattern;
|
||||
pattern << dataLocation << "/task." << seq->getId () << ".XXXXXX";
|
||||
char cpattern [PATH_MAX];
|
||||
strcpy (cpattern, pattern.str ().c_str ());
|
||||
mkstemp (cpattern);
|
||||
char* file = cpattern;
|
||||
|
||||
// Format the contents, T -> text, write to a file.
|
||||
std::string before = formatTask (conf, *seq);
|
||||
spit (file, before);
|
||||
|
||||
// Determine correct editor: .taskrc:editor > $VISUAL > $EDITOR > vi
|
||||
std::string editor = conf.get ("editor", "");
|
||||
char* peditor = getenv ("VISUAL");
|
||||
if (editor == "" && peditor) editor = std::string (peditor);
|
||||
peditor = getenv ("EDITOR");
|
||||
if (editor == "" && peditor) editor = std::string (peditor);
|
||||
if (editor == "") editor = "vi";
|
||||
|
||||
// Complete the command line.
|
||||
editor += " ";
|
||||
editor += file;
|
||||
|
||||
ARE_THESE_REALLY_HARMFUL:
|
||||
// Launch the editor.
|
||||
std::cout << "Launching '" << editor << "' now..." << std::endl;
|
||||
system (editor.c_str ());
|
||||
std::cout << "Editing complete." << std::endl;
|
||||
|
||||
// Slurp file.
|
||||
std::string after;
|
||||
slurp (file, after, false);
|
||||
|
||||
// TODO Remove this debugging code.
|
||||
//spit ("./before", before);
|
||||
//spit ("./after", after);
|
||||
|
||||
// Update seq based on what can be parsed back out of the file, but only
|
||||
// if changes were made.
|
||||
if (before != after)
|
||||
{
|
||||
std::cout << "Edits were detected." << std::endl;
|
||||
std::string problem = "";
|
||||
bool oops = false;
|
||||
|
||||
try
|
||||
{
|
||||
parseTask (conf, *seq, after);
|
||||
tdb.modifyT (*seq);
|
||||
}
|
||||
|
||||
catch (std::string& e)
|
||||
{
|
||||
problem = e;
|
||||
oops = true;
|
||||
}
|
||||
|
||||
if (oops)
|
||||
{
|
||||
std::cout << "Error: " << problem << std::endl;
|
||||
|
||||
// Preserve the edits.
|
||||
before = after;
|
||||
spit (file, before);
|
||||
|
||||
if (confirm ("Task couldn't handle your edits. Would you like to try again?"))
|
||||
goto ARE_THESE_REALLY_HARMFUL;
|
||||
}
|
||||
}
|
||||
else
|
||||
std::cout << "No edits were detected." << std::endl;
|
||||
|
||||
// Cleanup.
|
||||
unlink (file);
|
||||
}
|
||||
|
||||
return out.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
114
src/parse.cpp
114
src/parse.cpp
@@ -116,6 +116,7 @@ static const char* attributes[] =
|
||||
"",
|
||||
};
|
||||
|
||||
// Alphabetical please.
|
||||
static const char* commands[] =
|
||||
{
|
||||
"active",
|
||||
@@ -127,6 +128,8 @@ static const char* commands[] =
|
||||
"completed",
|
||||
"delete",
|
||||
"done",
|
||||
"duplicate",
|
||||
"edit",
|
||||
"export",
|
||||
"help",
|
||||
"history",
|
||||
@@ -141,6 +144,7 @@ static const char* commands[] =
|
||||
"stop",
|
||||
"summary",
|
||||
"tags",
|
||||
"timesheet",
|
||||
"undelete",
|
||||
"undo",
|
||||
"version",
|
||||
@@ -299,6 +303,9 @@ static bool validAttribute (
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static bool validId (const std::string& input)
|
||||
{
|
||||
if (input.length () == 0)
|
||||
return false;
|
||||
|
||||
for (size_t i = 0; i < input.length (); ++i)
|
||||
if (!::isdigit (input[i]))
|
||||
return false;
|
||||
@@ -306,6 +313,58 @@ static bool validId (const std::string& input)
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// 1,2-4,6
|
||||
static bool validSequence (
|
||||
const std::string& input,
|
||||
std::vector <int>& ids)
|
||||
{
|
||||
std::vector <std::string> ranges;
|
||||
split (ranges, input, ',');
|
||||
|
||||
std::vector <std::string>::iterator it;
|
||||
for (it = ranges.begin (); it != ranges.end (); ++it)
|
||||
{
|
||||
std::vector <std::string> range;
|
||||
split (range, *it, '-');
|
||||
|
||||
switch (range.size ())
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
if (! validId (range[0]))
|
||||
return false;
|
||||
|
||||
int id = ::atoi (range[0].c_str ());
|
||||
ids.push_back (id);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
{
|
||||
if (! validId (range[0]) ||
|
||||
! validId (range[1]))
|
||||
return false;
|
||||
|
||||
int low = ::atoi (range[0].c_str ());
|
||||
int high = ::atoi (range[1].c_str ());
|
||||
if (low >= high)
|
||||
return false;
|
||||
|
||||
for (int i = low; i <= high; ++i)
|
||||
ids.push_back (i);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ids.size () ? true : false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static bool validTag (const std::string& input)
|
||||
{
|
||||
@@ -390,15 +449,23 @@ bool validDuration (std::string& input)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Token Distinguishing characteristic
|
||||
// ------- -----------------------------
|
||||
// command first positional
|
||||
// id \d+
|
||||
// description default, accumulate
|
||||
// substitution /\w+/\w*/
|
||||
// tags [-+]\w+
|
||||
// attributes \w+:.+
|
||||
// Token EBNF
|
||||
// ------- ----------------------------------
|
||||
// command first non-id recognized argument
|
||||
//
|
||||
// substitution ::= "/" from "/" to "/g"
|
||||
// | "/" from "/" to "/" ;
|
||||
//
|
||||
// tags ::= "+" word
|
||||
// | "-" word ;
|
||||
//
|
||||
// attributes ::= word ":" value
|
||||
// | word ":"
|
||||
//
|
||||
// sequence ::= \d+ "," sequence
|
||||
// | \d+ "-" \d+ ;
|
||||
//
|
||||
// description (whatever isn't one of the above)
|
||||
void parse (
|
||||
std::vector <std::string>& args,
|
||||
std::string& command,
|
||||
@@ -407,6 +474,9 @@ void parse (
|
||||
{
|
||||
command = "";
|
||||
|
||||
bool foundSequence = false;
|
||||
bool foundSomethingAfterSequence = false;
|
||||
|
||||
std::string descCandidate = "";
|
||||
for (size_t i = 0; i < args.size (); ++i)
|
||||
{
|
||||
@@ -420,16 +490,24 @@ void parse (
|
||||
std::string from;
|
||||
std::string to;
|
||||
bool global;
|
||||
std::vector <int> sequence;
|
||||
|
||||
// An id is the first argument found that contains all digits.
|
||||
if (lowerCase (command) != "add" && // "add" doesn't require an ID
|
||||
task.getId () == 0 &&
|
||||
validId (arg))
|
||||
task.setId (::atoi (arg.c_str ()));
|
||||
if (lowerCase (command) != "add" && // "add" doesn't require an ID
|
||||
validSequence (arg, sequence) &&
|
||||
! foundSomethingAfterSequence)
|
||||
{
|
||||
foundSequence = true;
|
||||
foreach (id, sequence)
|
||||
task.addId (*id);
|
||||
}
|
||||
|
||||
// Tags begin with + or - and contain arbitrary text.
|
||||
else if (validTag (arg))
|
||||
{
|
||||
if (foundSequence)
|
||||
foundSomethingAfterSequence = true;
|
||||
|
||||
if (arg[0] == '+')
|
||||
task.addTag (arg.substr (1, std::string::npos));
|
||||
else if (arg[0] == '-')
|
||||
@@ -440,6 +518,9 @@ void parse (
|
||||
// value.
|
||||
else if ((colon = arg.find (":")) != std::string::npos)
|
||||
{
|
||||
if (foundSequence)
|
||||
foundSomethingAfterSequence = true;
|
||||
|
||||
std::string name = lowerCase (arg.substr (0, colon));
|
||||
std::string value = arg.substr (colon + 1, std::string::npos);
|
||||
|
||||
@@ -462,12 +543,18 @@ void parse (
|
||||
// Substitution of description text.
|
||||
else if (validSubstitution (arg, from, to, global))
|
||||
{
|
||||
if (foundSequence)
|
||||
foundSomethingAfterSequence = true;
|
||||
|
||||
task.setSubstitution (from, to, global);
|
||||
}
|
||||
|
||||
// Command.
|
||||
else if (command == "")
|
||||
{
|
||||
if (foundSequence)
|
||||
foundSomethingAfterSequence = true;
|
||||
|
||||
std::string l = lowerCase (arg);
|
||||
if (isCommand (l) && validCommand (l))
|
||||
command = l;
|
||||
@@ -482,6 +569,9 @@ void parse (
|
||||
// Anything else is just considered description.
|
||||
else
|
||||
{
|
||||
if (foundSequence)
|
||||
foundSomethingAfterSequence = true;
|
||||
|
||||
if (descCandidate.length ())
|
||||
descCandidate += " ";
|
||||
descCandidate += arg;
|
||||
|
||||
530
src/report.cpp
530
src/report.cpp
@@ -46,6 +46,53 @@
|
||||
#include <ncurses.h>
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void filterSequence (std::vector<T>& all, T& task)
|
||||
{
|
||||
std::vector <int> sequence = task.getAllIds ();
|
||||
|
||||
std::vector <T> filtered;
|
||||
std::vector <T>::iterator t;
|
||||
for (t = all.begin (); t != all.end (); ++t)
|
||||
{
|
||||
std::vector <int>::iterator s;
|
||||
for (s = sequence.begin (); s != sequence.end (); ++s)
|
||||
if (t->getId () == *s)
|
||||
filtered.push_back (*t);
|
||||
}
|
||||
|
||||
if (sequence.size () != filtered.size ())
|
||||
{
|
||||
std::vector <int> filteredSequence;
|
||||
std::vector <T>::iterator fs;
|
||||
for (fs = filtered.begin (); fs != filtered.end (); ++fs)
|
||||
filteredSequence.push_back (fs->getId ());
|
||||
|
||||
std::vector <int> left;
|
||||
std::vector <int> right;
|
||||
listDiff (filteredSequence, sequence, left, right);
|
||||
if (left.size ())
|
||||
throw std::string ("Sequence filtering error - please report this error");
|
||||
|
||||
if (right.size ())
|
||||
{
|
||||
std::stringstream out;
|
||||
out << "Task";
|
||||
|
||||
if (right.size () > 1) out << "s";
|
||||
|
||||
std::vector <int>::iterator s;
|
||||
for (s = right.begin (); s != right.end (); ++s)
|
||||
out << " " << *s;
|
||||
|
||||
out << " not found";
|
||||
throw out.str ();
|
||||
}
|
||||
}
|
||||
|
||||
all = filtered;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void filter (std::vector<T>& all, T& task)
|
||||
{
|
||||
@@ -265,47 +312,53 @@ std::string handleInfo (TDB& tdb, T& task, Config& conf)
|
||||
std::vector <T> tasks;
|
||||
tdb.allPendingT (tasks);
|
||||
|
||||
Table table;
|
||||
table.setTableWidth (width);
|
||||
table.setDateFormat (conf.get ("dateformat", "m/d/Y"));
|
||||
|
||||
table.addColumn ("Name");
|
||||
table.addColumn ("Value");
|
||||
|
||||
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false))
|
||||
{
|
||||
table.setColumnUnderline (0);
|
||||
table.setColumnUnderline (1);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnWidth (0, Table::minimum);
|
||||
table.setColumnWidth (1, Table::flexible);
|
||||
|
||||
table.setColumnJustification (0, Table::left);
|
||||
table.setColumnJustification (1, Table::left);
|
||||
|
||||
// Find the task.
|
||||
int count = 0;
|
||||
for (unsigned int i = 0; i < tasks.size (); ++i)
|
||||
{
|
||||
T refTask (tasks[i]);
|
||||
|
||||
if (refTask.getId () == task.getId ())
|
||||
if (refTask.getId () == task.getId () || task.sequenceContains (refTask.getId ()))
|
||||
{
|
||||
Date now;
|
||||
++count;
|
||||
|
||||
Table table;
|
||||
table.setTableWidth (width);
|
||||
table.setDateFormat (conf.get ("dateformat", "m/d/Y"));
|
||||
|
||||
table.addColumn ("Name");
|
||||
table.addColumn ("Value");
|
||||
|
||||
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false))
|
||||
{
|
||||
table.setColumnUnderline (0);
|
||||
table.setColumnUnderline (1);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnWidth (0, Table::minimum);
|
||||
table.setColumnWidth (1, Table::flexible);
|
||||
|
||||
table.setColumnJustification (0, Table::left);
|
||||
table.setColumnJustification (1, Table::left);
|
||||
Date now;
|
||||
|
||||
int row = table.addRow ();
|
||||
table.addCell (row, 0, "ID");
|
||||
table.addCell (row, 1, refTask.getId ());
|
||||
|
||||
std::string status = refTask.getStatus () == T::pending ? "Pending"
|
||||
: refTask.getStatus () == T::completed ? "Completed"
|
||||
: refTask.getStatus () == T::deleted ? "Deleted"
|
||||
: refTask.getStatus () == T::recurring ? "Recurring"
|
||||
: "";
|
||||
if (refTask.getAttribute ("parent") != "")
|
||||
status += " (Recurring)";
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Status");
|
||||
table.addCell (row, 1, ( refTask.getStatus () == T::pending ? "Pending"
|
||||
: refTask.getStatus () == T::completed ? "Completed"
|
||||
: refTask.getStatus () == T::deleted ? "Deleted"
|
||||
: refTask.getStatus () == T::recurring ? "Recurring"
|
||||
: ""));
|
||||
table.addCell (row, 1, status);
|
||||
|
||||
std::string description = refTask.getDescription ();
|
||||
std::string when;
|
||||
@@ -336,26 +389,36 @@ std::string handleInfo (TDB& tdb, T& task, Config& conf)
|
||||
table.addCell (row, 1, refTask.getAttribute ("priority"));
|
||||
}
|
||||
|
||||
if (refTask.getStatus () == T::recurring)
|
||||
if (refTask.getStatus () == T::recurring ||
|
||||
refTask.getAttribute ("parent") != "")
|
||||
{
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Recurrence");
|
||||
table.addCell (row, 1, refTask.getAttribute ("recur"));
|
||||
if (refTask.getAttribute ("recur") != "")
|
||||
{
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Recurrence");
|
||||
table.addCell (row, 1, refTask.getAttribute ("recur"));
|
||||
}
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Recur until");
|
||||
table.addCell (row, 1, refTask.getAttribute ("until"));
|
||||
if (refTask.getAttribute ("until") != "")
|
||||
{
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Recur until");
|
||||
table.addCell (row, 1, refTask.getAttribute ("until"));
|
||||
}
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Mask");
|
||||
table.addCell (row, 1, refTask.getAttribute ("mask"));
|
||||
}
|
||||
if (refTask.getAttribute ("mask") != "")
|
||||
{
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Mask");
|
||||
table.addCell (row, 1, refTask.getAttribute ("mask"));
|
||||
}
|
||||
|
||||
if (refTask.getAttribute ("parent") != "")
|
||||
{
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Parent task");
|
||||
table.addCell (row, 1, refTask.getAttribute ("parent"));
|
||||
if (refTask.getAttribute ("parent") != "")
|
||||
{
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Parent task");
|
||||
table.addCell (row, 1, refTask.getAttribute ("parent"));
|
||||
}
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Mask Index");
|
||||
@@ -422,10 +485,12 @@ std::string handleInfo (TDB& tdb, T& task, Config& conf)
|
||||
table.addCell (row, 1, allTags);
|
||||
}
|
||||
|
||||
// uuid
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "UUID");
|
||||
table.addCell (row, 1, refTask.getUUID ());
|
||||
|
||||
// entry
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Entered");
|
||||
Date dt (::atoi (refTask.getAttribute ("entry").c_str ()));
|
||||
@@ -440,14 +505,32 @@ std::string handleInfo (TDB& tdb, T& task, Config& conf)
|
||||
}
|
||||
|
||||
table.addCell (row, 1, entry + " (" + age + ")");
|
||||
|
||||
// fg
|
||||
std::string color = refTask.getAttribute ("fg");
|
||||
if (color != "")
|
||||
{
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Foreground color");
|
||||
table.addCell (row, 1, color);
|
||||
}
|
||||
|
||||
// bg
|
||||
color = refTask.getAttribute ("bg");
|
||||
if (color != "")
|
||||
{
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Background color");
|
||||
table.addCell (row, 1, color);
|
||||
}
|
||||
|
||||
out << optionalBlankLine (conf)
|
||||
<< table.render ()
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (table.rowCount ())
|
||||
out << optionalBlankLine (conf)
|
||||
<< table.render ()
|
||||
<< std::endl;
|
||||
else
|
||||
if (! count)
|
||||
out << "No matches." << std::endl;
|
||||
|
||||
return out.str ();
|
||||
@@ -1038,6 +1121,7 @@ std::string handleReportGHistory (TDB& tdb, T& task, Config& conf)
|
||||
if (task.getStatus () == T::deleted)
|
||||
{
|
||||
epoch = monthlyEpoch (task.getAttribute ("end"));
|
||||
groups[epoch] = 0;
|
||||
|
||||
if (deletedGroup.find (epoch) != deletedGroup.end ())
|
||||
deletedGroup[epoch] = deletedGroup[epoch] + 1;
|
||||
@@ -1047,6 +1131,7 @@ std::string handleReportGHistory (TDB& tdb, T& task, Config& conf)
|
||||
else if (task.getStatus () == T::completed)
|
||||
{
|
||||
epoch = monthlyEpoch (task.getAttribute ("end"));
|
||||
groups[epoch] = 0;
|
||||
|
||||
if (completedGroup.find (epoch) != completedGroup.end ())
|
||||
completedGroup[epoch] = completedGroup[epoch] + 1;
|
||||
@@ -1077,6 +1162,7 @@ std::string handleReportGHistory (TDB& tdb, T& task, Config& conf)
|
||||
if (task.getStatus () == T::deleted)
|
||||
{
|
||||
epoch = monthlyEpoch (task.getAttribute ("end"));
|
||||
groups[epoch] = 0;
|
||||
|
||||
if (deletedGroup.find (epoch) != deletedGroup.end ())
|
||||
deletedGroup[epoch] = deletedGroup[epoch] + 1;
|
||||
@@ -1086,6 +1172,8 @@ std::string handleReportGHistory (TDB& tdb, T& task, Config& conf)
|
||||
else if (task.getStatus () == T::completed)
|
||||
{
|
||||
epoch = monthlyEpoch (task.getAttribute ("end"));
|
||||
groups[epoch] = 0;
|
||||
|
||||
if (completedGroup.find (epoch) != completedGroup.end ())
|
||||
completedGroup[epoch] = completedGroup[epoch] + 1;
|
||||
else
|
||||
@@ -1234,6 +1322,209 @@ std::string handleReportGHistory (TDB& tdb, T& task, Config& conf)
|
||||
return out.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string handleReportTimesheet (TDB& tdb, T& task, Config& conf)
|
||||
{
|
||||
std::stringstream out;
|
||||
|
||||
// Determine window size, and set table accordingly.
|
||||
int width = conf.get ("defaultwidth", (int) 80);
|
||||
#ifdef HAVE_LIBNCURSES
|
||||
if (conf.get ("curses", true))
|
||||
{
|
||||
WINDOW* w = initscr ();
|
||||
width = w->_maxx + 1;
|
||||
endwin ();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Get all the tasks.
|
||||
std::vector <T> tasks;
|
||||
tdb.allT (tasks);
|
||||
filter (tasks, task);
|
||||
|
||||
// What day of the week does the user consider the first?
|
||||
int weekStart = Date::dayOfWeek (conf.get ("weekstart", "Monday"));
|
||||
if (weekStart == -1)
|
||||
throw std::string ("The 'weekstart' configuration variable does "
|
||||
"not contain a day name, such as 'Monday'.");
|
||||
|
||||
// Determine the date of the first day of the most recent report.
|
||||
Date today;
|
||||
Date start;
|
||||
start -= (((today.dayOfWeek () - weekStart) + 7) % 7) * 86400;
|
||||
|
||||
// Roll back to midnight.
|
||||
start = Date (start.month (), start.day (), start.year ());
|
||||
Date end = start + (7 * 86400) - 1;
|
||||
|
||||
// Determine how many reports to run.
|
||||
int quantity = 1;
|
||||
std::vector <int> sequence = task.getAllIds ();
|
||||
if (sequence.size () == 1)
|
||||
quantity = sequence[0];
|
||||
|
||||
for (int week = 0; week < quantity; ++week)
|
||||
{
|
||||
out << std::endl
|
||||
<< Text::colorize (Text::bold, Text::nocolor)
|
||||
<< start.toString (conf.get ("dateformat", "m/d/Y"))
|
||||
<< " - "
|
||||
<< end.toString (conf.get ("dateformat", "m/d/Y"))
|
||||
<< Text::colorize ()
|
||||
<< std::endl;
|
||||
|
||||
// Render the completed table.
|
||||
Table completed;
|
||||
completed.setTableWidth (width);
|
||||
completed.addColumn (" ");
|
||||
completed.addColumn ("Project");
|
||||
completed.addColumn ("Due");
|
||||
completed.addColumn ("Description");
|
||||
|
||||
completed.setColumnUnderline (1);
|
||||
completed.setColumnUnderline (2);
|
||||
completed.setColumnUnderline (3);
|
||||
|
||||
completed.setColumnWidth (0, Table::minimum);
|
||||
completed.setColumnWidth (1, Table::minimum);
|
||||
completed.setColumnWidth (2, Table::minimum);
|
||||
completed.setColumnWidth (3, Table::flexible);
|
||||
|
||||
completed.setColumnJustification (0, Table::left);
|
||||
completed.setColumnJustification (1, Table::left);
|
||||
completed.setColumnJustification (2, Table::right);
|
||||
completed.setColumnJustification (3, Table::left);
|
||||
|
||||
foreach (t, tasks)
|
||||
{
|
||||
// If task completed within range.
|
||||
if (t->getStatus () == T::completed)
|
||||
{
|
||||
Date compDate (::atoi (t->getAttribute ("end").c_str ()));
|
||||
if (compDate >= start && compDate < end)
|
||||
{
|
||||
int row = completed.addRow ();
|
||||
completed.addCell (row, 1, t->getAttribute ("project"));
|
||||
|
||||
std::string due = t->getAttribute ("due");
|
||||
if (due.length ())
|
||||
{
|
||||
Date d (::atoi (due.c_str ()));
|
||||
due = d.toString (conf.get ("dateformat", "m/d/Y"));
|
||||
completed.addCell (row, 2, due);
|
||||
}
|
||||
|
||||
std::string description = t->getDescription ();
|
||||
std::string when;
|
||||
std::map <time_t, std::string> annotations;
|
||||
t->getAnnotations (annotations);
|
||||
foreach (anno, annotations)
|
||||
{
|
||||
Date dt (anno->first);
|
||||
when = dt.toString (conf.get ("dateformat", "m/d/Y"));
|
||||
description += "\n" + when + " " + anno->second;
|
||||
}
|
||||
completed.addCell (row, 3, description);
|
||||
|
||||
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false))
|
||||
{
|
||||
Text::color fg = Text::colorCode (t->getAttribute ("fg"));
|
||||
Text::color bg = Text::colorCode (t->getAttribute ("bg"));
|
||||
autoColorize (*t, fg, bg, conf);
|
||||
completed.setRowFg (row, fg);
|
||||
completed.setRowBg (row, bg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
out << " Completed (" << completed.rowCount () << " tasks)" << std::endl;
|
||||
|
||||
if (completed.rowCount ())
|
||||
out << completed.render ()
|
||||
<< std::endl;
|
||||
|
||||
// Now render the started table.
|
||||
Table started;
|
||||
started.setTableWidth (width);
|
||||
started.addColumn (" ");
|
||||
started.addColumn ("Project");
|
||||
started.addColumn ("Due");
|
||||
started.addColumn ("Description");
|
||||
|
||||
started.setColumnUnderline (1);
|
||||
started.setColumnUnderline (2);
|
||||
started.setColumnUnderline (3);
|
||||
|
||||
started.setColumnWidth (0, Table::minimum);
|
||||
started.setColumnWidth (1, Table::minimum);
|
||||
started.setColumnWidth (2, Table::minimum);
|
||||
started.setColumnWidth (3, Table::flexible);
|
||||
|
||||
started.setColumnJustification (0, Table::left);
|
||||
started.setColumnJustification (1, Table::left);
|
||||
started.setColumnJustification (2, Table::right);
|
||||
started.setColumnJustification (3, Table::left);
|
||||
foreach (t, tasks)
|
||||
{
|
||||
// If task started within range, but not completed withing range.
|
||||
if (t->getStatus () == T::pending &&
|
||||
t->getAttribute ("start") != "")
|
||||
{
|
||||
Date startDate (::atoi (t->getAttribute ("start").c_str ()));
|
||||
if (startDate >= start && startDate < end)
|
||||
{
|
||||
int row = started.addRow ();
|
||||
started.addCell (row, 1, t->getAttribute ("project"));
|
||||
|
||||
std::string due = t->getAttribute ("due");
|
||||
if (due.length ())
|
||||
{
|
||||
Date d (::atoi (due.c_str ()));
|
||||
due = d.toString (conf.get ("dateformat", "m/d/Y"));
|
||||
started.addCell (row, 2, due);
|
||||
}
|
||||
|
||||
std::string description = t->getDescription ();
|
||||
std::string when;
|
||||
std::map <time_t, std::string> annotations;
|
||||
t->getAnnotations (annotations);
|
||||
foreach (anno, annotations)
|
||||
{
|
||||
Date dt (anno->first);
|
||||
when = dt.toString (conf.get ("dateformat", "m/d/Y"));
|
||||
description += "\n" + when + " " + anno->second;
|
||||
}
|
||||
started.addCell (row, 3, description);
|
||||
|
||||
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false))
|
||||
{
|
||||
Text::color fg = Text::colorCode (t->getAttribute ("fg"));
|
||||
Text::color bg = Text::colorCode (t->getAttribute ("bg"));
|
||||
autoColorize (*t, fg, bg, conf);
|
||||
started.setRowFg (row, fg);
|
||||
started.setRowBg (row, bg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
out << " Started (" << started.rowCount () << " tasks)" << std::endl;
|
||||
|
||||
if (started.rowCount ())
|
||||
out << started.render ()
|
||||
<< std::endl
|
||||
<< std::endl;
|
||||
|
||||
// Prior week.
|
||||
start -= 7 * 86400;
|
||||
end -= 7 * 86400;
|
||||
}
|
||||
|
||||
return out.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string renderMonths (
|
||||
int firstMonth,
|
||||
@@ -1728,6 +2019,17 @@ std::string handleReportStats (TDB& tdb, T& task, Config& conf)
|
||||
{
|
||||
std::stringstream out;
|
||||
|
||||
// Determine window size, and set table accordingly.
|
||||
int width = conf.get ("defaultwidth", (int) 80);
|
||||
#ifdef HAVE_LIBNCURSES
|
||||
if (conf.get ("curses", true))
|
||||
{
|
||||
WINDOW* w = initscr ();
|
||||
width = w->_maxx + 1;
|
||||
endwin ();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Get all the tasks.
|
||||
std::vector <T> tasks;
|
||||
tdb.allT (tasks);
|
||||
@@ -1786,44 +2088,126 @@ std::string handleReportStats (TDB& tdb, T& task, Config& conf)
|
||||
allProjects[project] = 0;
|
||||
}
|
||||
|
||||
out << "Pending " << pendingT << std::endl
|
||||
<< "Recurring " << recurringT << std::endl
|
||||
<< "Completed " << completedT << std::endl
|
||||
<< "Deleted " << deletedT << std::endl
|
||||
<< "Total " << totalT << std::endl;
|
||||
// Create a table for output.
|
||||
Table table;
|
||||
table.setTableWidth (width);
|
||||
table.setDateFormat (conf.get ("dateformat", "m/d/Y"));
|
||||
table.addColumn ("Category");
|
||||
table.addColumn ("Data");
|
||||
|
||||
out << "Annotations " << annotationsT << std::endl;
|
||||
out << "Unique tags " << allTags.size () << std::endl;
|
||||
out << "Projects " << allProjects.size () << std::endl;
|
||||
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false))
|
||||
{
|
||||
table.setColumnUnderline (0);
|
||||
table.setColumnUnderline (1);
|
||||
}
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
table.setColumnWidth (0, Table::minimum);
|
||||
table.setColumnWidth (1, Table::flexible);
|
||||
|
||||
table.setColumnJustification (0, Table::left);
|
||||
table.setColumnJustification (1, Table::left);
|
||||
|
||||
int row = table.addRow ();
|
||||
table.addCell (row, 0, "Pending");
|
||||
table.addCell (row, 1, pendingT);
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Recurring");
|
||||
table.addCell (row, 1, recurringT);
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Completed");
|
||||
table.addCell (row, 1, completedT);
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Deleted");
|
||||
table.addCell (row, 1, deletedT);
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Total");
|
||||
table.addCell (row, 1, totalT);
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Annotations");
|
||||
table.addCell (row, 1, annotationsT);
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Unique tags");
|
||||
table.addCell (row, 1, (int)allTags.size ());
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Projects");
|
||||
table.addCell (row, 1, (int)allProjects.size ());
|
||||
|
||||
if (totalT)
|
||||
out << "Tasks tagged " << std::setprecision (3) << (100.0 * taggedT / totalT) << "%" << std::endl;
|
||||
{
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Tasks tagged");
|
||||
|
||||
std::stringstream value;
|
||||
value << std::setprecision (3) << (100.0 * taggedT / totalT) << "%";
|
||||
table.addCell (row, 1, value.str ());
|
||||
}
|
||||
|
||||
if (tasks.size ())
|
||||
{
|
||||
Date e (earliest);
|
||||
out << "Oldest task " << e.toString (conf.get ("dateformat", "m/d/Y")) << std::endl;
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Oldest task");
|
||||
table.addCell (row, 1, e.toString (conf.get ("dateformat", "m/d/Y")));
|
||||
|
||||
Date l (latest);
|
||||
out << "Newest task " << l.toString (conf.get ("dateformat", "m/d/Y")) << std::endl;
|
||||
out << "Task used for " << formatSeconds (latest - earliest) << std::endl;
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Newest task");
|
||||
table.addCell (row, 1, l.toString (conf.get ("dateformat", "m/d/Y")));
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Task used for");
|
||||
table.addCell (row, 1, formatSeconds (latest - earliest));
|
||||
}
|
||||
|
||||
if (totalT)
|
||||
out << "Task added every " << formatSeconds ((latest - earliest) / totalT) << std::endl;
|
||||
{
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Task added every");
|
||||
table.addCell (row, 1, formatSeconds ((latest - earliest) / totalT));
|
||||
}
|
||||
|
||||
if (completedT)
|
||||
out << "Task completed every " << formatSeconds ((latest - earliest) / completedT) << std::endl;
|
||||
{
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Task completed every");
|
||||
table.addCell (row, 1, formatSeconds ((latest - earliest) / completedT));
|
||||
}
|
||||
|
||||
if (deletedT)
|
||||
out << "Task deleted every " << formatSeconds ((latest - earliest) / deletedT) << std::endl;
|
||||
{
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Task deleted every");
|
||||
table.addCell (row, 1, formatSeconds ((latest - earliest) / deletedT));
|
||||
}
|
||||
|
||||
if (pendingT || completedT)
|
||||
out << "Average time pending "
|
||||
<< formatSeconds ((int) ((daysPending / (pendingT + completedT)) * 86400))
|
||||
<< std::endl;
|
||||
{
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Average time pending");
|
||||
table.addCell (row, 1, formatSeconds ((int) ((daysPending / (pendingT + completedT)) * 86400)));
|
||||
}
|
||||
|
||||
if (totalT)
|
||||
out << "Average desc length " << (int) (descLength / totalT) << " characters" << std::endl;
|
||||
{
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 0, "Average desc length");
|
||||
std::stringstream value;
|
||||
value << (int) (descLength / totalT) << " characters";
|
||||
table.addCell (row, 1, value.str ());
|
||||
}
|
||||
|
||||
out << optionalBlankLine (conf)
|
||||
<< table.render ()
|
||||
<< optionalBlankLine (conf);
|
||||
|
||||
return out.str ();
|
||||
}
|
||||
@@ -2399,8 +2783,18 @@ std::string handleCustomReport (
|
||||
}
|
||||
}
|
||||
|
||||
// Limit the number of rows according to the report definition.
|
||||
int maximum = conf.get (std::string ("report.") + report + ".limit", (int)0);
|
||||
|
||||
// If the custom report has a defined limit, then allow an override, which
|
||||
// will show up as a single ID sequence.
|
||||
if (conf.get (std::string ("report.") + report + ".limit", (int)0) != 0)
|
||||
{
|
||||
std::vector <int> sequence = task.getAllIds ();
|
||||
if (sequence.size () == 1)
|
||||
maximum = sequence[0];
|
||||
}
|
||||
|
||||
std::stringstream out;
|
||||
if (table.rowCount ())
|
||||
out << optionalBlankLine (conf)
|
||||
|
||||
90
src/task.cpp
90
src/task.cpp
@@ -102,7 +102,19 @@ static std::string shortUsage (Config& conf)
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task ID /from/to/");
|
||||
table.addCell (row, 2, "Perform the substitution on the desc, for fixing mistakes");
|
||||
table.addCell (row, 2, "Performs one substitution on the task description, for fixing mistakes");
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task ID /from/to/g");
|
||||
table.addCell (row, 2, "Performs all substitutions on the task description, for fixing mistakes");
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task edit ID");
|
||||
table.addCell (row, 2, "Launches an editor to let you modify all aspects of a task directly, therefore it is to be used carefully");
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task duplicate ID [tags] [attrs] [desc...]");
|
||||
table.addCell (row, 2, "Duplicates the specified task, and allows modifications");
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task delete ID");
|
||||
@@ -125,7 +137,7 @@ static std::string shortUsage (Config& conf)
|
||||
table.addCell (row, 2, "Removes the 'start' time from a task");
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task done ID");
|
||||
table.addCell (row, 1, "task done ID [tags] [attrs] [desc...]");
|
||||
table.addCell (row, 2, "Marks the specified task as completed");
|
||||
|
||||
row = table.addRow ();
|
||||
@@ -144,6 +156,10 @@ static std::string shortUsage (Config& conf)
|
||||
table.addCell (row, 1, "task summary");
|
||||
table.addCell (row, 2, "Shows a report of task status by project");
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task timesheet [weeks]");
|
||||
table.addCell (row, 2, "Shows a weekly report of tasks completed and started");
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task history");
|
||||
table.addCell (row, 2, "Shows a report of task history, by month");
|
||||
@@ -210,7 +226,8 @@ static std::string shortUsage (Config& conf)
|
||||
<< std::endl
|
||||
<< "See http://www.beckingham.net/task.html for the latest releases and a "
|
||||
<< "full tutorial. New releases containing fixes and enhancements are "
|
||||
<< "made frequently."
|
||||
<< "made frequently. Join in the discussion of task, present and future, "
|
||||
<< "at http://groups.google.com/group/taskprogram"
|
||||
<< std::endl
|
||||
<< std::endl;
|
||||
|
||||
@@ -222,7 +239,13 @@ static std::string longUsage (Config& conf)
|
||||
{
|
||||
std::stringstream out;
|
||||
out << shortUsage (conf)
|
||||
<< "ID is the numeric identifier displayed by the 'task list' command." << "\n"
|
||||
<< "ID is the numeric identifier displayed by the 'task list' command. "
|
||||
<< "You can specify multiple IDs for task commands, and multiple tasks "
|
||||
<< "will be affected. To specify multiple IDs make sure you use one "
|
||||
<< "of these forms:" << "\n"
|
||||
<< " task delete 1,2,3" << "\n"
|
||||
<< " task info 1-3" << "\n"
|
||||
<< " task pri:H 1,2-5,19" << "\n"
|
||||
<< "\n"
|
||||
<< "Tags are arbitrary words, any quantity:" << "\n"
|
||||
<< " +tag The + means add the tag" << "\n"
|
||||
@@ -331,7 +354,7 @@ int main (int argc, char** argv)
|
||||
|
||||
catch (std::string& error)
|
||||
{
|
||||
std::cerr << error << std::endl;
|
||||
std::cout << error << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -452,7 +475,13 @@ void handleRecurrence (TDB& tdb, std::vector <T>& tasks)
|
||||
<< " ("
|
||||
<< trim (t->getDescription ())
|
||||
<< ") is past its 'until' date, and has be deleted" << std::endl;
|
||||
tdb.deleteT (*t);
|
||||
|
||||
// Determine the end date.
|
||||
char endTime[16];
|
||||
sprintf (endTime, "%u", (unsigned int) time (NULL));
|
||||
t->setAttribute ("end", endTime);
|
||||
t->setStatus (T::deleted);
|
||||
tdb.modifyT (*t);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -837,31 +866,34 @@ std::string runTaskCommand (
|
||||
std::string out;
|
||||
|
||||
// Read-only commands with no side effects.
|
||||
if (command == "export") { out = handleExport (tdb, task, conf); }
|
||||
else if (command == "projects") { out = handleProjects (tdb, task, conf); }
|
||||
else if (command == "tags") { out = handleTags (tdb, task, conf); }
|
||||
else if (command == "info") { out = handleInfo (tdb, task, conf); }
|
||||
else if (command == "stats") { out = handleReportStats (tdb, task, conf); }
|
||||
else if (command == "history") { out = handleReportHistory (tdb, task, conf); }
|
||||
else if (command == "ghistory") { out = handleReportGHistory (tdb, task, conf); }
|
||||
else if (command == "calendar") { out = handleReportCalendar (tdb, task, conf); }
|
||||
else if (command == "summary") { out = handleReportSummary (tdb, task, conf); }
|
||||
else if (command == "colors") { out = handleColor ( conf); }
|
||||
else if (command == "version") { out = handleVersion ( conf); }
|
||||
else if (command == "help") { out = longUsage ( conf); }
|
||||
if (command == "export") { out = handleExport (tdb, task, conf); }
|
||||
else if (command == "projects") { out = handleProjects (tdb, task, conf); }
|
||||
else if (command == "tags") { out = handleTags (tdb, task, conf); }
|
||||
else if (command == "info") { out = handleInfo (tdb, task, conf); }
|
||||
else if (command == "stats") { out = handleReportStats (tdb, task, conf); }
|
||||
else if (command == "history") { out = handleReportHistory (tdb, task, conf); }
|
||||
else if (command == "ghistory") { out = handleReportGHistory (tdb, task, conf); }
|
||||
else if (command == "calendar") { out = handleReportCalendar (tdb, task, conf); }
|
||||
else if (command == "summary") { out = handleReportSummary (tdb, task, conf); }
|
||||
else if (command == "timesheet") { out = handleReportTimesheet (tdb, task, conf); }
|
||||
else if (command == "colors") { out = handleColor ( conf); }
|
||||
else if (command == "version") { out = handleVersion ( conf); }
|
||||
else if (command == "help") { out = longUsage ( conf); }
|
||||
|
||||
// Commands that cause updates.
|
||||
else if (command == "" && task.getId ()) { cmdMod = true; out = handleModify (tdb, task, conf); }
|
||||
else if (command == "add") { cmdMod = true; out = handleAdd (tdb, task, conf); }
|
||||
else if (command == "append") { cmdMod = true; out = handleAppend (tdb, task, conf); }
|
||||
else if (command == "annotate") { cmdMod = true; out = handleAnnotate (tdb, task, conf); }
|
||||
else if (command == "done") { cmdMod = true; out = handleDone (tdb, task, conf); }
|
||||
else if (command == "undelete") { cmdMod = true; out = handleUndelete (tdb, task, conf); }
|
||||
else if (command == "delete") { cmdMod = true; out = handleDelete (tdb, task, conf); }
|
||||
else if (command == "start") { cmdMod = true; out = handleStart (tdb, task, conf); }
|
||||
else if (command == "stop") { cmdMod = true; out = handleStop (tdb, task, conf); }
|
||||
else if (command == "undo") { cmdMod = true; out = handleUndo (tdb, task, conf); }
|
||||
else if (command == "import") { cmdMod = true; out = handleImport (tdb, task, conf); }
|
||||
else if (command == "" && task.getId ()) { cmdMod = true; out = handleModify (tdb, task, conf); }
|
||||
else if (command == "add") { cmdMod = true; out = handleAdd (tdb, task, conf); }
|
||||
else if (command == "append") { cmdMod = true; out = handleAppend (tdb, task, conf); }
|
||||
else if (command == "annotate") { cmdMod = true; out = handleAnnotate (tdb, task, conf); }
|
||||
else if (command == "done") { cmdMod = true; out = handleDone (tdb, task, conf); }
|
||||
else if (command == "undelete") { cmdMod = true; out = handleUndelete (tdb, task, conf); }
|
||||
else if (command == "delete") { cmdMod = true; out = handleDelete (tdb, task, conf); }
|
||||
else if (command == "start") { cmdMod = true; out = handleStart (tdb, task, conf); }
|
||||
else if (command == "stop") { cmdMod = true; out = handleStop (tdb, task, conf); }
|
||||
else if (command == "undo") { cmdMod = true; out = handleUndo (tdb, task, conf); }
|
||||
else if (command == "import") { cmdMod = true; out = handleImport (tdb, task, conf); }
|
||||
else if (command == "duplicate") { cmdMod = true; out = handleDuplicate (tdb, task, conf); }
|
||||
else if (command == "edit") { cmdMod = true; out = handleEdit (tdb, task, conf); }
|
||||
|
||||
// Command that display IDs and therefore need TDB::gc first.
|
||||
else if (command == "completed") { if (gc) gcMod = tdb.gc (); out = handleCompleted (tdb, task, conf); }
|
||||
|
||||
55
src/task.h
55
src/task.h
@@ -57,6 +57,7 @@ for (typeof (c) *foreach_p = & (c); \
|
||||
void parse (std::vector <std::string>&, std::string&, T&, Config&);
|
||||
bool validPriority (const std::string&);
|
||||
bool validDate (std::string&, Config&);
|
||||
bool validDuration (std::string&);
|
||||
void loadCustomReports (Config&);
|
||||
bool isCustomReport (const std::string&);
|
||||
void allCustomReports (std::vector <std::string>&);
|
||||
@@ -89,9 +90,19 @@ std::string handleStop (TDB&, T&, Config&);
|
||||
std::string handleUndo (TDB&, T&, Config&);
|
||||
std::string handleColor (Config&);
|
||||
std::string handleAnnotate (TDB&, T&, Config&);
|
||||
std::string handleDuplicate (TDB&, T&, Config&);
|
||||
T findT (int, const std::vector <T>&);
|
||||
int deltaAppend (T&, T&);
|
||||
int deltaDescription (T&, T&);
|
||||
int deltaTags (T&, T&);
|
||||
int deltaAttributes (T&, T&);
|
||||
int deltaSubstitutions (T&, T&);
|
||||
|
||||
// edit.cpp
|
||||
std::string handleEdit (TDB&, T&, Config&);
|
||||
|
||||
// report.cpp
|
||||
void filterSequence (std::vector<T>&, T&);
|
||||
void filter (std::vector<T>&, T&);
|
||||
std::string handleInfo (TDB&, T&, Config&);
|
||||
std::string handleCompleted (TDB&, T&, Config&);
|
||||
@@ -103,6 +114,7 @@ std::string handleReportCalendar (TDB&, T&, Config&);
|
||||
std::string handleReportActive (TDB&, T&, Config&);
|
||||
std::string handleReportOverdue (TDB&, T&, Config&);
|
||||
std::string handleReportStats (TDB&, T&, Config&);
|
||||
std::string handleReportTimesheet (TDB&, T&, Config&);
|
||||
|
||||
std::string handleCustomReport (TDB&, T&, Config&, const std::string&);
|
||||
void validReportColumns (const std::vector <std::string>&);
|
||||
@@ -143,6 +155,8 @@ std::string expandPath (const std::string&);
|
||||
#endif
|
||||
|
||||
bool slurp (const std::string&, std::vector <std::string>&, bool trimLines = false);
|
||||
bool slurp (const std::string&, std::string&, bool trimLines = false);
|
||||
void spit (const std::string&, const std::string&);
|
||||
|
||||
// rules.cpp
|
||||
void initializeColorRules (Config&);
|
||||
@@ -151,4 +165,45 @@ void autoColorize (T&, Text::color&, Text::color&, Config&);
|
||||
// import.cpp
|
||||
std::string handleImport (TDB&, T&, Config&);
|
||||
|
||||
// list template
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template <class T> void listDiff (
|
||||
const T& left, const T& right, T& leftOnly, T& rightOnly)
|
||||
{
|
||||
leftOnly.clear ();
|
||||
rightOnly.clear ();
|
||||
|
||||
for (unsigned int l = 0; l < left.size (); ++l)
|
||||
{
|
||||
bool found = false;
|
||||
for (unsigned int r = 0; r < right.size (); ++r)
|
||||
{
|
||||
if (left[l] == right[r])
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
leftOnly.push_back (left[l]);
|
||||
}
|
||||
|
||||
for (unsigned int r = 0; r < right.size (); ++r)
|
||||
{
|
||||
bool found = false;
|
||||
for (unsigned int l = 0; l < left.size (); ++l)
|
||||
{
|
||||
if (left[l] == right[r])
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
rightOnly.push_back (right[r]);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
1
src/tests/.gitignore
vendored
1
src/tests/.gitignore
vendored
@@ -5,3 +5,4 @@ date.t
|
||||
duration.t
|
||||
text.t
|
||||
autocomplete.t
|
||||
parse.t
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
PROJECT = t.t tdb.t date.t duration.t t.benchmark.t text.t autocomplete.t
|
||||
PROJECT = t.t tdb.t date.t duration.t t.benchmark.t text.t autocomplete.t \
|
||||
parse.t
|
||||
CFLAGS = -I. -I.. -Wall -pedantic -ggdb3 -fno-rtti
|
||||
LFLAGS = -L/usr/local/lib
|
||||
OBJECTS = ../TDB.o ../T.o ../parse.o ../text.o ../Date.o ../util.o ../Config.o
|
||||
@@ -38,3 +39,6 @@ text.t: text.t.o $(OBJECTS) test.o
|
||||
autocomplete.t: autocomplete.t.o $(OBJECTS) test.o
|
||||
g++ autocomplete.t.o $(OBJECTS) test.o $(LFLAGS) -o autocomplete.t
|
||||
|
||||
parse.t: parse.t.o $(OBJECTS) test.o
|
||||
g++ parse.t.o $(OBJECTS) test.o $(LFLAGS) -o parse.t
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 14;
|
||||
use Test::More tests => 13;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'annual.rc')
|
||||
|
||||
@@ -51,49 +51,49 @@ qx{../task rc:confirm.rc add foo} for 1 .. 10;
|
||||
|
||||
# Test the various forms of "yes".
|
||||
my $output = qx{echo "yes" | ../task rc:confirm.rc del 1};
|
||||
like ($output, qr/Permanently delete task\? \(y\/n\)/, 'confirmation - yes works');
|
||||
like ($output, qr/Permanently delete task 1 'foo'\? \(y\/n\)/, 'confirmation - yes works');
|
||||
unlike ($output, qr/Task not deleted\./, 'confirmation - yes works');
|
||||
|
||||
$output = qx{echo "ye" | ../task rc:confirm.rc del 2};
|
||||
like ($output, qr/Permanently delete task\? \(y\/n\)/, 'confirmation - ye works');
|
||||
like ($output, qr/Permanently delete task 2 'foo'\? \(y\/n\)/, 'confirmation - ye works');
|
||||
unlike ($output, qr/Task not deleted\./, 'confirmation - ye works');
|
||||
|
||||
$output = qx{echo "y" | ../task rc:confirm.rc del 3};
|
||||
like ($output, qr/Permanently delete task\? \(y\/n\)/, 'confirmation - y works');
|
||||
like ($output, qr/Permanently delete task 3 'foo'\? \(y\/n\)/, 'confirmation - y works');
|
||||
unlike ($output, qr/Task not deleted\./, 'confirmation - y works');
|
||||
|
||||
$output = qx{echo "YES" | ../task rc:confirm.rc del 4};
|
||||
like ($output, qr/Permanently delete task\? \(y\/n\)/, 'confirmation - YES works');
|
||||
like ($output, qr/Permanently delete task 4 'foo'\? \(y\/n\)/, 'confirmation - YES works');
|
||||
unlike ($output, qr/Task not deleted\./, 'confirmation - YES works');
|
||||
|
||||
$output = qx{echo "YE" | ../task rc:confirm.rc del 5};
|
||||
like ($output, qr/Permanently delete task\? \(y\/n\)/, 'confirmation - YE works');
|
||||
like ($output, qr/Permanently delete task 5 'foo'\? \(y\/n\)/, 'confirmation - YE works');
|
||||
unlike ($output, qr/Task not deleted\./, 'confirmation - YE works');
|
||||
|
||||
$output = qx{echo "Y" | ../task rc:confirm.rc del 6};
|
||||
like ($output, qr/Permanently delete task\? \(y\/n\)/, 'confirmation - Y works');
|
||||
like ($output, qr/Permanently delete task 6 'foo'\? \(y\/n\)/, 'confirmation - Y works');
|
||||
unlike ($output, qr/Task not deleted\./, 'confirmation - Y works');
|
||||
|
||||
# Test the various forms of "no".
|
||||
$output = qx{echo "no" | ../task rc:confirm.rc del 7};
|
||||
like ($output, qr/Permanently delete task\? \(y\/n\)/, 'confirmation - no works');
|
||||
like ($output, qr/Permanently delete task 7 'foo'\? \(y\/n\)/, 'confirmation - no works');
|
||||
like ($output, qr/Task not deleted\./, 'confirmation - no works');
|
||||
|
||||
$output = qx{echo "n" | ../task rc:confirm.rc del 7};
|
||||
like ($output, qr/Permanently delete task\? \(y\/n\)/, 'confirmation - n works');
|
||||
like ($output, qr/Permanently delete task 7 'foo'\? \(y\/n\)/, 'confirmation - n works');
|
||||
like ($output, qr/Task not deleted\./, 'confirmation - n works');
|
||||
|
||||
$output = qx{echo "NO" | ../task rc:confirm.rc del 7};
|
||||
like ($output, qr/Permanently delete task\? \(y\/n\)/, 'confirmation - NO works');
|
||||
like ($output, qr/Permanently delete task 7 'foo'\? \(y\/n\)/, 'confirmation - NO works');
|
||||
like ($output, qr/Task not deleted\./, 'confirmation - NO works');
|
||||
|
||||
$output = qx{echo "N" | ../task rc:confirm.rc del 7};
|
||||
like ($output, qr/Permanently delete task\? \(y\/n\)/, 'confirmation - N works');
|
||||
like ($output, qr/Permanently delete task 7 'foo'\? \(y\/n\)/, 'confirmation - N works');
|
||||
like ($output, qr/Task not deleted\./, 'confirmation - N works');
|
||||
|
||||
# Test newlines.
|
||||
$output = qx{cat response.txt | ../task rc:confirm.rc del 7};
|
||||
like ($output, qr/(Permanently delete task\? \(y\/n\)) \1 \1/, 'confirmation - \n re-prompt works');
|
||||
like ($output, qr/(Permanently delete task 7 'foo'\? \(y\/n\)) \1 \1/, 'confirmation - \n re-prompt works');
|
||||
|
||||
# Cleanup.
|
||||
unlink 'pending.data';
|
||||
|
||||
@@ -57,7 +57,7 @@ like ($output, qr/^No matches/, 'No matches');
|
||||
ok (-r 'completed.data', 'completed.data created');
|
||||
|
||||
$output = qx{../task rc:undelete.rc undelete 1};
|
||||
like ($output, qr/reliably undeleted/, 'can only be reliable undeleted...');
|
||||
like ($output, qr/Task 1 not found/, 'Task 1 not found');
|
||||
|
||||
$output = qx{../task rc:undelete.rc info 1};
|
||||
like ($output, qr/No matches./, 'no matches');
|
||||
|
||||
66
src/tests/duplicate.t
Executable file
66
src/tests/duplicate.t
Executable file
@@ -0,0 +1,66 @@
|
||||
#! /usr/bin/perl
|
||||
################################################################################
|
||||
## task - a command line task list manager.
|
||||
##
|
||||
## Copyright 2006 - 2009, Paul Beckingham.
|
||||
## All rights reserved.
|
||||
##
|
||||
## 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 the Free Software
|
||||
## Foundation; either version 2 of the License, or (at your option) any later
|
||||
## version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
## details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License along with
|
||||
## this program; if not, write to the
|
||||
##
|
||||
## Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor,
|
||||
## Boston, MA
|
||||
## 02110-1301
|
||||
## USA
|
||||
##
|
||||
################################################################################
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 11;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'dup.rc')
|
||||
{
|
||||
print $fh "data.location=.\n";
|
||||
close $fh;
|
||||
ok (-r 'dup.rc', 'Created dup.rc');
|
||||
}
|
||||
|
||||
# Test the duplicate command.
|
||||
qx{../task rc:dup.rc add foo};
|
||||
qx{../task rc:dup.rc duplicate 1};
|
||||
my $output = qx{../task rc:dup.rc info 2};
|
||||
like ($output, qr/ID\s+2/, 'duplicate new id');
|
||||
like ($output, qr/Status\s+Pending/, 'duplicate same status');
|
||||
like ($output, qr/Description\s+foo/, 'duplicate same description');
|
||||
|
||||
# Test the en passant modification while duplicating.
|
||||
qx{../task rc:dup.rc duplicate 1 priority:H /foo/FOO/ +tag};
|
||||
$output = qx{../task rc:dup.rc info 3};
|
||||
like ($output, qr/ID\s+3/, 'duplicate new id');
|
||||
like ($output, qr/Status\s+Pending/, 'duplicate same status');
|
||||
like ($output, qr/Description\s+FOO/, 'duplicate modified description');
|
||||
like ($output, qr/Priority\s+H/, 'duplicate added priority');
|
||||
like ($output, qr/Tags\s+tag/, 'duplicate added tag');
|
||||
|
||||
# Cleanup.
|
||||
unlink 'pending.data';
|
||||
ok (!-r 'pending.data', 'Removed pending.data');
|
||||
|
||||
unlink 'dup.rc';
|
||||
ok (!-r 'dup.rc', 'Removed dup.rc');
|
||||
|
||||
exit 0;
|
||||
|
||||
64
src/tests/enpassant.t
Executable file
64
src/tests/enpassant.t
Executable file
@@ -0,0 +1,64 @@
|
||||
#! /usr/bin/perl
|
||||
################################################################################
|
||||
## task - a command line task list manager.
|
||||
##
|
||||
## Copyright 2006 - 2009, Paul Beckingham.
|
||||
## All rights reserved.
|
||||
##
|
||||
## 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 the Free Software
|
||||
## Foundation; either version 2 of the License, or (at your option) any later
|
||||
## version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
## details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License along with
|
||||
## this program; if not, write to the
|
||||
##
|
||||
## Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor,
|
||||
## Boston, MA
|
||||
## 02110-1301
|
||||
## USA
|
||||
##
|
||||
################################################################################
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 11;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'enp.rc')
|
||||
{
|
||||
print $fh "data.location=.\n";
|
||||
close $fh;
|
||||
ok (-r 'enp.rc', 'Created enp.rc');
|
||||
}
|
||||
|
||||
# Test the en passant feature.
|
||||
qx{../task rc:enp.rc add foo};
|
||||
qx{../task rc:enp.rc add foo bar};
|
||||
qx{../task rc:enp.rc do 1,2 /foo/FOO/ pri:H +tag};
|
||||
my $output = qx{../task rc:enp.rc info 1};
|
||||
like ($output, qr/Status\s+Completed/, 'en passant 1 status change');
|
||||
like ($output, qr/Description\s+FOO/, 'en passant 1 description change');
|
||||
like ($output, qr/Priority\s+H/, 'en passant 1 description change');
|
||||
like ($output, qr/Tags\s+tag/, 'en passant 1 description change');
|
||||
$output = qx{../task rc:enp.rc info 2};
|
||||
like ($output, qr/Status\s+Completed/, 'en passant 2 status change');
|
||||
like ($output, qr/Description\s+FOO bar/, 'en passant 2 description change');
|
||||
like ($output, qr/Priority\s+H/, 'en passant 2 description change');
|
||||
like ($output, qr/Tags\s+tag/, 'en passant 2 description change');
|
||||
|
||||
# Cleanup.
|
||||
unlink 'pending.data';
|
||||
ok (!-r 'pending.data', 'Removed pending.data');
|
||||
|
||||
unlink 'enp.rc';
|
||||
ok (!-r 'enp.rc', 'Removed enp.rc');
|
||||
|
||||
exit 0;
|
||||
|
||||
@@ -47,12 +47,12 @@ my $setup = "../task rc:nag.rc add due:yesterday one;"
|
||||
. "../task rc:nag.rc add six;";
|
||||
qx{$setup};
|
||||
|
||||
like (qx{../task rc:nag.rc do 6}, qr/NAG/, 'do pri: -> nag');
|
||||
like (qx{../task rc:nag.rc do 5}, qr/NAG/, 'do pri:L -> nag');
|
||||
like (qx{../task rc:nag.rc do 4}, qr/NAG/, 'do pri:M-> nag');
|
||||
like (qx{../task rc:nag.rc do 3}, qr/NAG/, 'do pri:H-> nag');
|
||||
like (qx{../task rc:nag.rc do 2}, qr/NAG/, 'do due:tomorrow -> nag');
|
||||
ok (qx{../task rc:nag.rc do 1} !~ qr/NAG/, 'do due:yesterday -> no nag');
|
||||
like (qx{../task rc:nag.rc do 6}, qr/NAG/, 'do pri: -> nag');
|
||||
like (qx{../task rc:nag.rc do 5}, qr/NAG/, 'do pri:L -> nag');
|
||||
like (qx{../task rc:nag.rc do 4}, qr/NAG/, 'do pri:M-> nag');
|
||||
like (qx{../task rc:nag.rc do 3}, qr/NAG/, 'do pri:H-> nag');
|
||||
like (qx{../task rc:nag.rc do 2}, qr/NAG/, 'do due:tomorrow -> nag');
|
||||
unlike (qx{../task rc:nag.rc do 1}, qr/NAG/, 'do due:yesterday -> no nag');
|
||||
|
||||
# Cleanup.
|
||||
unlink 'pending.data';
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 33;
|
||||
use Test::More tests => 55;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'oldest.rc')
|
||||
@@ -66,30 +66,56 @@ qx{../task rc:oldest.rc add ten; sleep 1};
|
||||
qx{../task rc:oldest.rc add eleven};
|
||||
|
||||
$output = qx{../task rc:oldest.rc oldest};
|
||||
like ($output, qr/one/, 'oldest: one');
|
||||
like ($output, qr/two/, 'oldest: two');
|
||||
like ($output, qr/three/, 'oldest: three');
|
||||
like ($output, qr/four/, 'oldest: four');
|
||||
like ($output, qr/five/, 'oldest: five');
|
||||
like ($output, qr/six/, 'oldest: six');
|
||||
like ($output, qr/seven/, 'oldest: seven');
|
||||
like ($output, qr/eight/, 'oldest: eight');
|
||||
like ($output, qr/nine/, 'oldest: nine');
|
||||
like ($output, qr/ten/, 'oldest: ten');
|
||||
like ($output, qr/one/, 'oldest: one');
|
||||
like ($output, qr/two/, 'oldest: two');
|
||||
like ($output, qr/three/, 'oldest: three');
|
||||
like ($output, qr/four/, 'oldest: four');
|
||||
like ($output, qr/five/, 'oldest: five');
|
||||
like ($output, qr/six/, 'oldest: six');
|
||||
like ($output, qr/seven/, 'oldest: seven');
|
||||
like ($output, qr/eight/, 'oldest: eight');
|
||||
like ($output, qr/nine/, 'oldest: nine');
|
||||
like ($output, qr/ten/, 'oldest: ten');
|
||||
unlike ($output, qr/eleven/, 'no: eleven');
|
||||
|
||||
$output = qx{../task rc:oldest.rc oldest 3};
|
||||
like ($output, qr/one/, 'oldest: one');
|
||||
like ($output, qr/two/, 'oldest: two');
|
||||
like ($output, qr/three/, 'oldest: three');
|
||||
unlike ($output, qr/four/, 'no: four');
|
||||
unlike ($output, qr/five/, 'no: five');
|
||||
unlike ($output, qr/six/, 'no: six');
|
||||
unlike ($output, qr/seven/, 'no: seven');
|
||||
unlike ($output, qr/eight/, 'no: eight');
|
||||
unlike ($output, qr/nine/, 'no: nine');
|
||||
unlike ($output, qr/ten/, 'no: ten');
|
||||
unlike ($output, qr/eleven/, 'no: eleven');
|
||||
|
||||
$output = qx{../task rc:oldest.rc newest};
|
||||
unlike ($output, qr/one/, 'no: one');
|
||||
like ($output, qr/two/, 'newest: two');
|
||||
like ($output, qr/three/, 'newest: three');
|
||||
like ($output, qr/four/, 'newest: four');
|
||||
like ($output, qr/five/, 'newest: five');
|
||||
like ($output, qr/six/, 'newest: six');
|
||||
like ($output, qr/seven/, 'newest: seven');
|
||||
like ($output, qr/eight/, 'newest: eight');
|
||||
like ($output, qr/nine/, 'newest: nine');
|
||||
like ($output, qr/ten/, 'newest: ten');
|
||||
like ($output, qr/eleven/, 'newest: eleven');
|
||||
unlike ($output, qr/one/, 'no: one');
|
||||
like ($output, qr/two/, 'newest: two');
|
||||
like ($output, qr/three/, 'newest: three');
|
||||
like ($output, qr/four/, 'newest: four');
|
||||
like ($output, qr/five/, 'newest: five');
|
||||
like ($output, qr/six/, 'newest: six');
|
||||
like ($output, qr/seven/, 'newest: seven');
|
||||
like ($output, qr/eight/, 'newest: eight');
|
||||
like ($output, qr/nine/, 'newest: nine');
|
||||
like ($output, qr/ten/, 'newest: ten');
|
||||
like ($output, qr/eleven/, 'newest: eleven');
|
||||
|
||||
$output = qx{../task rc:oldest.rc newest 3};
|
||||
unlike ($output, qr/one/, 'no: one');
|
||||
unlike ($output, qr/two/, 'no: two');
|
||||
unlike ($output, qr/three/, 'no: three');
|
||||
unlike ($output, qr/four/, 'no: four');
|
||||
unlike ($output, qr/five/, 'no: five');
|
||||
unlike ($output, qr/six/, 'no: six');
|
||||
unlike ($output, qr/seven/, 'no: seven');
|
||||
unlike ($output, qr/eight/, 'no: eight');
|
||||
like ($output, qr/nine/, 'newest: nine');
|
||||
like ($output, qr/ten/, 'newest: ten');
|
||||
like ($output, qr/eleven/, 'newest: eleven');
|
||||
|
||||
# Cleanup.
|
||||
unlink 'pending.data';
|
||||
|
||||
134
src/tests/parse.t.cpp
Normal file
134
src/tests/parse.t.cpp
Normal file
@@ -0,0 +1,134 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// task - a command line task list manager.
|
||||
//
|
||||
// Copyright 2006 - 2009, Paul Beckingham.
|
||||
// All rights reserved.
|
||||
//
|
||||
// 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 the Free Software
|
||||
// Foundation; either version 2 of the License, or (at your option) any later
|
||||
// version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
// details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with
|
||||
// this program; if not, write to the
|
||||
//
|
||||
// Free Software Foundation, Inc.,
|
||||
// 51 Franklin Street, Fifth Floor,
|
||||
// Boston, MA
|
||||
// 02110-1301
|
||||
// USA
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#include <iostream>
|
||||
#include "task.h"
|
||||
#include "test.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest t (18);
|
||||
|
||||
std::vector <std::string> args;
|
||||
std::string command;
|
||||
|
||||
Config conf;
|
||||
conf.set ("dateformat", "m/d/Y");
|
||||
|
||||
{
|
||||
T task;
|
||||
split (args, "add foo", ' ');
|
||||
parse (args, command, task, conf);
|
||||
t.is (command, "add", "(1) command found");
|
||||
t.is (task.getId (), 0, "(1) zero id on add");
|
||||
t.is (task.getDescription (), "foo", "(1) correct description");
|
||||
}
|
||||
|
||||
{
|
||||
T task;
|
||||
split (args, "delete 1,3-5,7", ' ');
|
||||
parse (args, command, task, conf);
|
||||
std::vector <int> sequence = task.getAllIds ();
|
||||
t.is (sequence.size (), (size_t)5, "(2) sequence length");
|
||||
if (sequence.size () == 5)
|
||||
{
|
||||
t.is (sequence[0], 1, "(2) sequence[0] == 1");
|
||||
t.is (sequence[1], 3, "(2) sequence[1] == 3");
|
||||
t.is (sequence[2], 4, "(2) sequence[2] == 4");
|
||||
t.is (sequence[3], 5, "(2) sequence[3] == 5");
|
||||
t.is (sequence[4], 7, "(2) sequence[4] == 7");
|
||||
}
|
||||
else
|
||||
{
|
||||
t.fail ("(2) sequence[0] == 1");
|
||||
t.fail ("(2) sequence[1] == 3");
|
||||
t.fail ("(2) sequence[2] == 4");
|
||||
t.fail ("(2) sequence[3] == 5");
|
||||
t.fail ("(2) sequence[4] == 7");
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
T task;
|
||||
split (args, "delete 1,2 3,4", ' ');
|
||||
parse (args, command, task, conf);
|
||||
std::vector <int> sequence = task.getAllIds ();
|
||||
t.is (sequence.size (), (size_t)4, "(3) sequence length");
|
||||
if (sequence.size () == 4)
|
||||
{
|
||||
t.is (sequence[0], 1, "(3) sequence[0] == 1");
|
||||
t.is (sequence[1], 2, "(3) sequence[1] == 2");
|
||||
t.is (sequence[2], 3, "(3) sequence[2] == 3");
|
||||
t.is (sequence[3], 4, "(3) sequence[3] == 4");
|
||||
}
|
||||
else
|
||||
{
|
||||
t.fail ("(3) sequence[0] == 1");
|
||||
t.fail ("(3) sequence[1] == 2");
|
||||
t.fail ("(3) sequence[2] == 3");
|
||||
t.fail ("(3) sequence[3] == 4");
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
T task;
|
||||
split (args, "1 There are 7 days in a week", ' ');
|
||||
parse (args, command, task, conf);
|
||||
std::vector <int> sequence = task.getAllIds ();
|
||||
t.is (sequence.size (), (size_t)1, "(4) sequence length");
|
||||
if (sequence.size () == 1)
|
||||
{
|
||||
t.is (sequence[0], 1, "(4) sequence[0] == 1");
|
||||
}
|
||||
else
|
||||
{
|
||||
t.fail ("(4) sequence[0] == 1");
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
T task;
|
||||
args.clear ();
|
||||
args.push_back ("1");
|
||||
args.push_back ("4-123 is back-ordered");
|
||||
parse (args, command, task, conf);
|
||||
std::vector <int> sequence = task.getAllIds ();
|
||||
t.is (sequence.size (), (size_t)1, "(5) sequence length");
|
||||
if (sequence.size () == 1)
|
||||
{
|
||||
t.is (sequence[0], 1, "(5) sequence[0] == 1");
|
||||
}
|
||||
else
|
||||
{
|
||||
t.fail ("(5) sequence[0] == 1");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
125
src/tests/sequence.t
Executable file
125
src/tests/sequence.t
Executable file
@@ -0,0 +1,125 @@
|
||||
#! /usr/bin/perl
|
||||
################################################################################
|
||||
## task - a command line task list manager.
|
||||
##
|
||||
## Copyright 2006 - 2009, Paul Beckingham.
|
||||
## All rights reserved.
|
||||
##
|
||||
## 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 the Free Software
|
||||
## Foundation; either version 2 of the License, or (at your option) any later
|
||||
## version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
## details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License along with
|
||||
## this program; if not, write to the
|
||||
##
|
||||
## Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor,
|
||||
## Boston, MA
|
||||
## 02110-1301
|
||||
## USA
|
||||
##
|
||||
################################################################################
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 27;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'seq.rc')
|
||||
{
|
||||
print $fh "data.location=.\n";
|
||||
close $fh;
|
||||
ok (-r 'seq.rc', 'Created seq.rc');
|
||||
}
|
||||
|
||||
# Test sequences in done/undo
|
||||
qx{../task rc:seq.rc add one mississippi};
|
||||
qx{../task rc:seq.rc add two mississippi};
|
||||
qx{../task rc:seq.rc do 1,2};
|
||||
my $output = qx{../task rc:seq.rc info 1};
|
||||
like ($output, qr/Status\s+Completed/, 'sequence do 1');
|
||||
$output = qx{../task rc:seq.rc info 2};
|
||||
like ($output, qr/Status\s+Completed/, 'sequence do 2');
|
||||
qx{../task rc:seq.rc undo 1,2};
|
||||
$output = qx{../task rc:seq.rc info 1};
|
||||
like ($output, qr/Status\s+Pending/, 'sequence undo 1');
|
||||
$output = qx{../task rc:seq.rc info 2};
|
||||
like ($output, qr/Status\s+Pending/, 'sequence undo 2');
|
||||
|
||||
# Test sequences in delete/undelete
|
||||
qx{../task rc:seq.rc delete 1,2};
|
||||
$output = qx{../task rc:seq.rc info 1};
|
||||
like ($output, qr/Status\s+Deleted/, 'sequence delete 1');
|
||||
$output = qx{../task rc:seq.rc info 2};
|
||||
like ($output, qr/Status\s+Deleted/, 'sequence delete 2');
|
||||
qx{../task rc:seq.rc undelete 1,2};
|
||||
$output = qx{../task rc:seq.rc info 1};
|
||||
like ($output, qr/Status\s+Pending/, 'sequence undelete 1');
|
||||
$output = qx{../task rc:seq.rc info 2};
|
||||
like ($output, qr/Status\s+Pending/, 'sequence undelete 2');
|
||||
|
||||
# Test sequences in start/stop
|
||||
qx{../task rc:seq.rc start 1,2};
|
||||
$output = qx{../task rc:seq.rc info 1};
|
||||
like ($output, qr/Start/, 'sequence start 1');
|
||||
$output = qx{../task rc:seq.rc info 2};
|
||||
like ($output, qr/Start/, 'sequence start 2');
|
||||
qx{../task rc:seq.rc stop 1,2};
|
||||
$output = qx{../task rc:seq.rc info 1};
|
||||
unlike ($output, qr/Start/, 'sequence stop 1');
|
||||
$output = qx{../task rc:seq.rc info 2};
|
||||
unlike ($output, qr/Start/, 'sequence stop 2');
|
||||
|
||||
# Test sequences in modify
|
||||
qx{../task rc:seq.rc 1,2 +tag};
|
||||
$output = qx{../task rc:seq.rc info 1};
|
||||
like ($output, qr/Tags\s+tag/, 'sequence modify 1');
|
||||
$output = qx{../task rc:seq.rc info 2};
|
||||
like ($output, qr/Tags\s+tag/, 'sequence modify 2');
|
||||
qx{../task rc:seq.rc 1,2 -tag};
|
||||
$output = qx{../task rc:seq.rc info 1};
|
||||
unlike ($output, qr/Tags\s+tag/, 'sequence unmodify 1');
|
||||
$output = qx{../task rc:seq.rc info 2};
|
||||
unlike ($output, qr/Tags\s+tag/, 'sequence unmodify 2');
|
||||
|
||||
# Test sequences in substitutions
|
||||
qx{../task rc:seq.rc 1,2 /miss/Miss/};
|
||||
$output = qx{../task rc:seq.rc info 1};
|
||||
like ($output, qr/Description\s+one Miss/, 'sequence substitution 1');
|
||||
$output = qx{../task rc:seq.rc info 2};
|
||||
like ($output, qr/Description\s+two Miss/, 'sequence substitution 2');
|
||||
|
||||
# Test sequences in info
|
||||
$output = qx{../task rc:seq.rc info 1,2};
|
||||
like ($output, qr/Description\s+one Miss/, 'sequence info 1');
|
||||
like ($output, qr/Description\s+two Miss/, 'sequence info 2');
|
||||
|
||||
# Test sequences in duplicate
|
||||
qx{../task rc:seq.rc duplicate 1,2 pri:H};
|
||||
$output = qx{../task rc:seq.rc info 3};
|
||||
like ($output, qr/Priority\s+H/, 'sequence duplicate 1');
|
||||
$output = qx{../task rc:seq.rc info 4};
|
||||
like ($output, qr/Priority\s+H/, 'sequence duplicate 2');
|
||||
|
||||
# Test sequences in annotate
|
||||
qx{../task rc:seq.rc annotate 1,2 note};
|
||||
$output = qx{../task rc:seq.rc info 1};
|
||||
like ($output, qr/\d+\/\d+\/\d+ note/, 'sequence annotate 1');
|
||||
$output = qx{../task rc:seq.rc info 2};
|
||||
like ($output, qr/\d+\/\d+\/\d+ note/, 'sequence annotate 2');
|
||||
|
||||
# Cleanup.
|
||||
unlink 'pending.data';
|
||||
ok (!-r 'pending.data', 'Removed pending.data');
|
||||
|
||||
unlink 'seq.rc';
|
||||
ok (!-r 'seq.rc', 'Removed seq.rc');
|
||||
|
||||
exit 0;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 7;
|
||||
use Test::More tests => 9;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'subst.rc')
|
||||
@@ -58,6 +58,16 @@ qx{../task rc:subst.rc 1 /bar/BAR/g};
|
||||
$output = qx{../task rc:subst.rc info 1};
|
||||
like ($output, qr/BAR BAR BAR/, 'global substitution in annotation');
|
||||
|
||||
qx{../task rc:subst.rc 1 /FOO/aaa/};
|
||||
qx{../task rc:subst.rc 1 /FOO/bbb/};
|
||||
qx{../task rc:subst.rc 1 /FOO/ccc/};
|
||||
$output = qx{../task rc:subst.rc info 1};
|
||||
like ($output, qr/aaa bbb ccc/, 'individual successive substitution in description');
|
||||
|
||||
qx{../task rc:subst.rc 1 /bbb//};
|
||||
$output = qx{../task rc:subst.rc info 1};
|
||||
like ($output, qr/aaa ccc/, 'word deletion in description');
|
||||
|
||||
# Cleanup.
|
||||
unlink 'pending.data';
|
||||
ok (!-r 'pending.data', 'Removed pending.data');
|
||||
|
||||
@@ -86,7 +86,7 @@ int main (int argc, char** argv)
|
||||
t.setDescription ("sample");
|
||||
std::string format = t.compose ();
|
||||
test.is (format.substr (36, 20), " - [foo] [bar:baz] [", "compose tag, attribute");
|
||||
test.is (format.substr (66, 16), ":'woof'] sample\n", "compose annotation");
|
||||
test.is (format.substr (66, 16), ":\"woof\"] sample\n", "compose annotation");
|
||||
test.is (t.getAnnotationCount (), 1, "annotation count");
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -77,7 +77,8 @@ int main (int argc, char** argv)
|
||||
// TODO Modify task.
|
||||
|
||||
// Complete task.
|
||||
t.ok (tdb.completeT (t1), "TDB::completeT t1");;
|
||||
t1.setStatus (T::completed);
|
||||
t.ok (tdb.modifyT (t1), "TDB::modifyT (completed) t1");;
|
||||
t.ok (tdb.pendingT (all), "TDB::pendingT read db");
|
||||
t.is ((int) all.size (), 0, "empty db");
|
||||
t.ok (tdb.allPendingT (all), "TDB::allPendingT read db");
|
||||
@@ -105,7 +106,8 @@ int main (int argc, char** argv)
|
||||
t.ok (tdb.addT (t2), "TDB::addT t2");
|
||||
|
||||
// Delete task.
|
||||
t.ok (tdb.deleteT (t2), "TDB::deleteT t2");
|
||||
t2.setStatus (T::deleted);
|
||||
t.ok (tdb.modifyT (t2), "TDB::modifyT (deleted) t2");
|
||||
|
||||
// GC the files.
|
||||
t.is (tdb.gc (), 1, "1 <- TDB::gc");
|
||||
|
||||
@@ -56,8 +56,8 @@ $output = qx{../task rc:undo.rc do 1; ../task rc:undo.rc list};
|
||||
like ($output, qr/^No matches/, 'No matches');
|
||||
|
||||
$output = qx{../task rc:undo.rc undo 1; ../task rc:undo.rc info 1};
|
||||
like ($output, qr/Task 1 not found/, 'task not found');
|
||||
like ($output, qr/reliably undone/, 'can only be reliable undone...');
|
||||
like ($output, qr/Task 1 not found/, 'Task 1 not found');
|
||||
like ($output, qr/No matches/, 'No matches');
|
||||
|
||||
# Cleanup.
|
||||
ok (-r 'pending.data', 'Need to remove pending.data');
|
||||
|
||||
44
src/util.cpp
44
src/util.cpp
@@ -208,9 +208,12 @@ const std::string uuid ()
|
||||
{
|
||||
uuid_t id;
|
||||
uuid_generate (id);
|
||||
char buffer[100];
|
||||
char buffer[100] = {0};
|
||||
uuid_unparse_lower (id, buffer);
|
||||
|
||||
// Bug found by Steven de Brouwer.
|
||||
buffer[36] = '\0';
|
||||
|
||||
return std::string (buffer);
|
||||
}
|
||||
|
||||
@@ -271,6 +274,7 @@ const std::string uuid ()
|
||||
id[33] = randomHexDigit ();
|
||||
id[34] = randomHexDigit ();
|
||||
id[35] = randomHexDigit ();
|
||||
id[36] = '\0';
|
||||
|
||||
return id;
|
||||
}
|
||||
@@ -430,3 +434,41 @@ bool slurp (
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool slurp (
|
||||
const std::string& file,
|
||||
std::string& contents,
|
||||
bool trimLines /* = false */)
|
||||
{
|
||||
contents = "";
|
||||
|
||||
std::ifstream in (file.c_str ());
|
||||
if (in.good ())
|
||||
{
|
||||
std::string line;
|
||||
while (getline (in, line))
|
||||
{
|
||||
if (trimLines) line = trim (line);
|
||||
contents += line + "\n";
|
||||
}
|
||||
|
||||
in.close ();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void spit (const std::string& file, const std::string& contents)
|
||||
{
|
||||
std::ofstream out (file.c_str ());
|
||||
if (out.good ())
|
||||
{
|
||||
out << contents;
|
||||
out.close ();
|
||||
}
|
||||
else
|
||||
throw std::string ("Could not write file '") + file + "'";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
56
task_completion.sh
Normal file
56
task_completion.sh
Normal file
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# bash completion support for task 1.7.0-2
|
||||
# Copyright (C) 2009 Federico Hernandez <ultrafredde@gmail.com>
|
||||
# Distributed under the GNU General Public License, version 2.0
|
||||
#
|
||||
# The routines will do completion of:
|
||||
#
|
||||
# *) task subcommands
|
||||
# *) local and remote tag names
|
||||
#
|
||||
# To use these routines:
|
||||
#
|
||||
# 1) Copy this file to somewhere (e.g. ~/.task-completion.sh).
|
||||
# 2) Added the following line to your .bashrc:
|
||||
# source ~/.task-completion.sh
|
||||
#
|
||||
# OR
|
||||
#
|
||||
# 3) Copy the file to /etc/bash_complettion.d
|
||||
# 4) source /etc/bash_completion
|
||||
#
|
||||
# To submit patches/bug reports:
|
||||
#
|
||||
# *) Send them to the mailing list:
|
||||
#
|
||||
# taskprogram@googlegroups.com
|
||||
#
|
||||
# *) CC the all patchesi/bug reports to:
|
||||
#
|
||||
# Federico Hernandez <ultrafredde@gmail.com>
|
||||
#
|
||||
|
||||
_task()
|
||||
{
|
||||
local cur prev opts base
|
||||
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
opts="active add annotate append calendar color completed delete done duplicate edit export ghistory help history import info list long ls newest next oldest overdue projects start stats stop summary tags timesheet undelete undo version"
|
||||
|
||||
case "${prev}" in
|
||||
ls|list|long)
|
||||
if [[ ${cur} == +* ]] ; then
|
||||
local tags=$( task tags | egrep -v 'tags|^$'|sed 's/^/+/' )
|
||||
COMPREPLY=( $(compgen -W "${tags}" -- ${cur}) )
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
return 0
|
||||
}
|
||||
complete -F _task task
|
||||
Reference in New Issue
Block a user