Compare commits
524 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b4ae3b54b | ||
|
|
716936acaa | ||
|
|
db3cfc939d | ||
|
|
c6a6f04697 | ||
|
|
f2863c50b4 | ||
|
|
7c82c44759 | ||
|
|
7efbfe29e4 | ||
|
|
f1785c6da9 | ||
|
|
029f3af578 | ||
|
|
31f0804207 | ||
|
|
fa035c3fde | ||
|
|
0a0793b2ca | ||
|
|
774cf3e2d9 | ||
|
|
140accc3d7 | ||
|
|
29a7837fda | ||
|
|
6ceca1d424 | ||
|
|
5666feaab9 | ||
|
|
a1dbb0c294 | ||
|
|
3a9e128c4a | ||
|
|
28810447d1 | ||
|
|
72f8fec136 | ||
|
|
724a4a02a0 | ||
|
|
cfd997111b | ||
|
|
9b5c0c81a3 | ||
|
|
2ca3fd5f3c | ||
|
|
5e4d387d83 | ||
|
|
820cc4b2e5 | ||
|
|
ec4e6af00d | ||
|
|
3b82be9c16 | ||
|
|
cdd1c4681d | ||
|
|
c25f312477 | ||
|
|
8be1c53d92 | ||
|
|
1fced1b8a9 | ||
|
|
197b440cc2 | ||
|
|
96f04ffc25 | ||
|
|
f59e15185f | ||
|
|
8577449960 | ||
|
|
9720e7dab4 | ||
|
|
1579705fec | ||
|
|
4d2c97f2c3 | ||
|
|
073ff9032d | ||
|
|
b61471ca0e | ||
|
|
8275181022 | ||
|
|
f2abdfd562 | ||
|
|
a8ed0e7d55 | ||
|
|
f6a7a8720e | ||
|
|
ea82d88816 | ||
|
|
1187ad16cc | ||
|
|
63bbe857c8 | ||
|
|
23ac9895ab | ||
|
|
4b37fea21f | ||
|
|
db7ebf9029 | ||
|
|
575433542f | ||
|
|
7ae5e4657d | ||
|
|
309ee57783 | ||
|
|
11b7d2edbf | ||
|
|
4f7805d005 | ||
|
|
a356d14f0c | ||
|
|
cf473863d9 | ||
|
|
32cf553d4e | ||
|
|
ba957344ef | ||
|
|
6f4f468d0d | ||
|
|
73d789c593 | ||
|
|
c167fa665e | ||
|
|
264fd264e9 | ||
|
|
6a0960174f | ||
|
|
3957c3567a | ||
|
|
7525d4a921 | ||
|
|
b7a72c5252 | ||
|
|
82b5c27fe8 | ||
|
|
99aaa4cc80 | ||
|
|
7c8b3c9699 | ||
|
|
6e56849bce | ||
|
|
fec65a0f24 | ||
|
|
f0b9ceb17b | ||
|
|
c6f9d2c4b2 | ||
|
|
25d4392edf | ||
|
|
974841883b | ||
|
|
6752695fce | ||
|
|
0043a2fc9e | ||
|
|
31e1333c2a | ||
|
|
5d566ddcbd | ||
|
|
6ef490a093 | ||
|
|
15373daf85 | ||
|
|
08b7b5b800 | ||
|
|
39cc00ce9d | ||
|
|
dbb0998f9d | ||
|
|
406f77efe2 | ||
|
|
c023e3e721 | ||
|
|
8337f78efe | ||
|
|
097a87a371 | ||
|
|
2fc1d83b55 | ||
|
|
b87a9225eb | ||
|
|
933b2d8ebe | ||
|
|
e361c2c751 | ||
|
|
156357285c | ||
|
|
7f3db8f201 | ||
|
|
d564aac978 | ||
|
|
60667dbcaa | ||
|
|
19f57ffead | ||
|
|
92f22149c0 | ||
|
|
3ed7fe265e | ||
|
|
df45c84266 | ||
|
|
3a3cfef0c3 | ||
|
|
08233c438a | ||
|
|
fb13483cec | ||
|
|
f6ecc08b51 | ||
|
|
796ec14c31 | ||
|
|
8a94602eb8 | ||
|
|
8c74495b11 | ||
|
|
51badfa4ee | ||
|
|
08066b694c | ||
|
|
f89c35f736 | ||
|
|
3380cac00e | ||
|
|
c448dc5b60 | ||
|
|
08bc64aeb9 | ||
|
|
825860488e | ||
|
|
87916eb546 | ||
|
|
b9fe3673fb | ||
|
|
1a7adea217 | ||
|
|
38b04f4632 | ||
|
|
93e80462a1 | ||
|
|
80ac338b8d | ||
|
|
a41839b242 | ||
|
|
926f85ea7c | ||
|
|
383d596516 | ||
|
|
639cd27ef0 | ||
|
|
1b368d5ff9 | ||
|
|
a084aac4ca | ||
|
|
dc2f5425fa | ||
|
|
bf038b37ac | ||
|
|
886c030452 | ||
|
|
f011f6e23f | ||
|
|
a5c4f35e06 | ||
|
|
07027abf99 | ||
|
|
08d5db0b49 | ||
|
|
54fac39f85 | ||
|
|
7c5ddee4e5 | ||
|
|
88ed4d0035 | ||
|
|
15e96eb02f | ||
|
|
da96962b00 | ||
|
|
83701168a4 | ||
|
|
844cda943a | ||
|
|
33988c2c90 | ||
|
|
f0c8c7d1b1 | ||
|
|
3215e3d78e | ||
|
|
ae47fb7265 | ||
|
|
be35dde6f0 | ||
|
|
641d232dea | ||
|
|
f1951f83dc | ||
|
|
5877a54b89 | ||
|
|
a5566da07a | ||
|
|
8dcdeeac8b | ||
|
|
c25a7ff085 | ||
|
|
cd95282c10 | ||
|
|
7d6a7266d3 | ||
|
|
510d2e6377 | ||
|
|
a629b17fec | ||
|
|
a5616fd195 | ||
|
|
aafb33287d | ||
|
|
78047b71a0 | ||
|
|
22979bb13d | ||
|
|
7b15ab8c22 | ||
|
|
f12df9cec9 | ||
|
|
900ad3c26b | ||
|
|
c7b792bf47 | ||
|
|
0344448b3a | ||
|
|
fc55a5521f | ||
|
|
f92219e5cd | ||
|
|
5db328f95c | ||
|
|
ce03d38c7d | ||
|
|
e5916d0feb | ||
|
|
d6d867c1cf | ||
|
|
01b5d0a66b | ||
|
|
f7d0f500fc | ||
|
|
253fd35dc7 | ||
|
|
ba098d790f | ||
|
|
f71630a416 | ||
|
|
67315bf77f | ||
|
|
9e67ae0132 | ||
|
|
a6f8d93fe1 | ||
|
|
ec779bb0e8 | ||
|
|
271e28f609 | ||
|
|
d8124d1aad | ||
|
|
116e5adaf2 | ||
|
|
30a2ab8ea8 | ||
|
|
c4f7e1a869 | ||
|
|
9442df8342 | ||
|
|
802ff9df05 | ||
|
|
7dc035d9ff | ||
|
|
9e2c6f8d47 | ||
|
|
a863abf2b0 | ||
|
|
79189c448c | ||
|
|
fdda485032 | ||
|
|
77283241a9 | ||
|
|
96ca7eb5f2 | ||
|
|
0961a011f4 | ||
|
|
ad81810fd3 | ||
|
|
e6f142be17 | ||
|
|
4424c5e450 | ||
|
|
ca9cd46f1c | ||
|
|
5ac1b1c6dd | ||
|
|
6dc30a9a1a | ||
|
|
7b8df7a439 | ||
|
|
f15e93ccc8 | ||
|
|
1407e0410e | ||
|
|
9415f62482 | ||
|
|
0141d10d56 | ||
|
|
560bf53f42 | ||
|
|
53431da5d9 | ||
|
|
823e3d51d0 | ||
|
|
8e778712ea | ||
|
|
072acdbb18 | ||
|
|
d506e19d93 | ||
|
|
743baf00cf | ||
|
|
0b3d38b0e6 | ||
|
|
940c7a793f | ||
|
|
8f8ad813cd | ||
|
|
c248a32cab | ||
|
|
41843d77b0 | ||
|
|
80b5a584b7 | ||
|
|
a2bd6d8342 | ||
|
|
2c0bb1663d | ||
|
|
def0223afa | ||
|
|
13b6bf3312 | ||
|
|
b4b41215a2 | ||
|
|
ee40f89804 | ||
|
|
5a01fe003d | ||
|
|
d23d0fafb7 | ||
|
|
ef3e072436 | ||
|
|
3169490219 | ||
|
|
a3736f6363 | ||
|
|
7d4ccb652e | ||
|
|
204c95993b | ||
|
|
1bdede371e | ||
|
|
261b062369 | ||
|
|
9a33aa2997 | ||
|
|
993b94c701 | ||
|
|
5f1edbfce1 | ||
|
|
639e04d853 | ||
|
|
665863809d | ||
|
|
03d564dd78 | ||
|
|
49ad7c2ce2 | ||
|
|
de43e34c5e | ||
|
|
d4f6f00b29 | ||
|
|
284330ea1d | ||
|
|
508559f766 | ||
|
|
f64cbe1e81 | ||
|
|
1d1be49bbd | ||
|
|
3ab2410df3 | ||
|
|
de4be46cab | ||
|
|
3e8cb20284 | ||
|
|
5b2328cd6c | ||
|
|
7c5055de7a | ||
|
|
7158942d03 | ||
|
|
8f60b1f9c5 | ||
|
|
02f1fa371c | ||
|
|
0d88df1c18 | ||
|
|
2b8ce968fc | ||
|
|
037514bcbf | ||
|
|
3745f83a7b | ||
|
|
cf831a9b7c | ||
|
|
368df43583 | ||
|
|
8db04b8ec1 | ||
|
|
d9cf0fb923 | ||
|
|
8205fd2446 | ||
|
|
91afa9b567 | ||
|
|
c903185481 | ||
|
|
d295755bb7 | ||
|
|
8e214d1b14 | ||
|
|
6df55c9156 | ||
|
|
bdfd22ad88 | ||
|
|
e3ea548de0 | ||
|
|
36ad7ead41 | ||
|
|
5c8b7148b4 | ||
|
|
5d9ca9864e | ||
|
|
aceebb0723 | ||
|
|
db49efd72f | ||
|
|
abc988476d | ||
|
|
ee9d303b10 | ||
|
|
2aa3163451 | ||
|
|
136f849aa8 | ||
|
|
b4035d6ff5 | ||
|
|
f339672b89 | ||
|
|
d1a6fecde3 | ||
|
|
7a48d25eaa | ||
|
|
9143d8b8e7 | ||
|
|
d8c5927362 | ||
|
|
78b8fc5dc7 | ||
|
|
b5c4bf0a6d | ||
|
|
25b7f42810 | ||
|
|
20493ec7d8 | ||
|
|
46db62ff00 | ||
|
|
ce507c0011 | ||
|
|
cd70d56260 | ||
|
|
410175efd3 | ||
|
|
5c9f1f7b45 | ||
|
|
99f6e6d634 | ||
|
|
281366e38b | ||
|
|
87a35d4dec | ||
|
|
3d832a0d5a | ||
|
|
83fa5a6e55 | ||
|
|
43cdb0fa3a | ||
|
|
4411fc02c5 | ||
|
|
292e2f1b89 | ||
|
|
06c50efa63 | ||
|
|
65b8fb7bce | ||
|
|
668fd2301e | ||
|
|
04c3e9e537 | ||
|
|
43e4f8a485 | ||
|
|
4c55b8c9af | ||
|
|
4837e9aa9d | ||
|
|
9ea69ea802 | ||
|
|
4d42584ca0 | ||
|
|
b8ae54275e | ||
|
|
dc72a22887 | ||
|
|
de9c0b97f6 | ||
|
|
3475995f39 | ||
|
|
2a6ce539d0 | ||
|
|
6baff92b5a | ||
|
|
2ff8d8329f | ||
|
|
8505d8a42c | ||
|
|
98973a9390 | ||
|
|
ba23b926dd | ||
|
|
2f23406087 | ||
|
|
b4fc2b5583 | ||
|
|
6ce3285c77 | ||
|
|
182b5427cd | ||
|
|
51def4b12b | ||
|
|
7119c42780 | ||
|
|
112621ef13 | ||
|
|
4d9ac995fe | ||
|
|
54ca77bfab | ||
|
|
61fc32d04f | ||
|
|
1cb295ef67 | ||
|
|
dd82835ac4 | ||
|
|
297f2b6e99 | ||
|
|
119827e4e1 | ||
|
|
88469fc5f9 | ||
|
|
0c5984c517 | ||
|
|
78da4ffb90 | ||
|
|
38b9e54955 | ||
|
|
4098e54238 | ||
|
|
1e8eac0e3d | ||
|
|
de66200028 | ||
|
|
180d3e75ff | ||
|
|
ad26d98d0f | ||
|
|
de8c7d230f | ||
|
|
0693f3cfc4 | ||
|
|
22368b9a40 | ||
|
|
2d25cf6f59 | ||
|
|
1236abc7d5 | ||
|
|
3749378867 | ||
|
|
ccbb71bab4 | ||
|
|
7693245c1d | ||
|
|
e41282122d | ||
|
|
18b810b033 | ||
|
|
5cfa4454ed | ||
|
|
923991df1b | ||
|
|
b7bbd96b62 | ||
|
|
64bf571c13 | ||
|
|
af49564194 | ||
|
|
c64c6ee870 | ||
|
|
741afd2240 | ||
|
|
51afff2e6e | ||
|
|
a369d1ed2d | ||
|
|
e833cf05c5 | ||
|
|
7d58ddff6b | ||
|
|
5cad0a0d4e | ||
|
|
52f13a97a7 | ||
|
|
9cbbf2b71c | ||
|
|
7fb907c76c | ||
|
|
c8cba22a3d | ||
|
|
778ba44beb | ||
|
|
e76f63aa01 | ||
|
|
512dcf5d48 | ||
|
|
cf329ab3f5 | ||
|
|
dbabcdfed4 | ||
|
|
65347b7a21 | ||
|
|
cebece6d23 | ||
|
|
34d5a07d90 | ||
|
|
acb83130fa | ||
|
|
0250145895 | ||
|
|
2d5c88994a | ||
|
|
5a0a28e39b | ||
|
|
f3503923c0 | ||
|
|
958637e2ca | ||
|
|
258328facd | ||
|
|
6bb9cd49ea | ||
|
|
bb807776cf | ||
|
|
ef0b221b0f | ||
|
|
9a0220f3d4 | ||
|
|
8b2eac62ba | ||
|
|
e96ef5e729 | ||
|
|
4b1bdf4423 | ||
|
|
c6826a86bb | ||
|
|
16db5de994 | ||
|
|
df3bcb1a4d | ||
|
|
cb2eadcb2f | ||
|
|
611cf69c99 | ||
|
|
18c19ab9ed | ||
|
|
aabd179ffc | ||
|
|
ab025b27ff | ||
|
|
735608d5b9 | ||
|
|
2cececd205 | ||
|
|
9b59eefbc3 | ||
|
|
57daa02232 | ||
|
|
849835ed24 | ||
|
|
fa920f02aa | ||
|
|
e3ad04aa37 | ||
|
|
b33e26f24d | ||
|
|
6570a42eee | ||
|
|
78b4e4fcc8 | ||
|
|
ec027b707d | ||
|
|
67c28b7015 | ||
|
|
411c735d4e | ||
|
|
342624f272 | ||
|
|
8b1a21d206 | ||
|
|
c7f3371429 | ||
|
|
759b30a9ac | ||
|
|
2d28ac19a7 | ||
|
|
b8a05f10d4 | ||
|
|
5859b2d54a | ||
|
|
362d3f7c4a | ||
|
|
df75e549a1 | ||
|
|
01526e298c | ||
|
|
4c95ba86bb | ||
|
|
9df8187396 | ||
|
|
8d45d40a90 | ||
|
|
b025f0524b | ||
|
|
cf923b23c8 | ||
|
|
e369ee796d | ||
|
|
484c8cc367 | ||
|
|
58fe2326db | ||
|
|
e857804ccc | ||
|
|
c6b5576194 | ||
|
|
cb381bf388 | ||
|
|
1544d180a9 | ||
|
|
197e569d08 | ||
|
|
a81040e7e9 | ||
|
|
7ac8bfe737 | ||
|
|
f6f1fe0f02 | ||
|
|
b525fef67d | ||
|
|
5daf8d3101 | ||
|
|
e32855e5ab | ||
|
|
44737f91e9 | ||
|
|
3e7ed49374 | ||
|
|
ce0bea73e5 | ||
|
|
5f641824fd | ||
|
|
c51348b9c1 | ||
|
|
fc543c7986 | ||
|
|
e15bcc004c | ||
|
|
a5ea60e711 | ||
|
|
379d7dfc6e | ||
|
|
4a1a464f0a | ||
|
|
93d210e7db | ||
|
|
e20f7bee4e | ||
|
|
8551d96490 | ||
|
|
127075bcad | ||
|
|
3b6c62309e | ||
|
|
15adcfe1a0 | ||
|
|
89534afa84 | ||
|
|
205a2bd984 | ||
|
|
2ca2e81a18 | ||
|
|
18652a834d | ||
|
|
32960d5e17 | ||
|
|
6f926e6bea | ||
|
|
f4ba6015a8 | ||
|
|
84c85b7596 | ||
|
|
2b69190ce2 | ||
|
|
909f48a371 | ||
|
|
34d737f700 | ||
|
|
acca829aed | ||
|
|
bb58b796fd | ||
|
|
603843821b | ||
|
|
ba000e1a5c | ||
|
|
875a3307d5 | ||
|
|
3380e105f6 | ||
|
|
1f30757c01 | ||
|
|
06ebd56be8 | ||
|
|
0497939742 | ||
|
|
ecde7d1ad2 | ||
|
|
e3727c0101 | ||
|
|
9b5f317b4a | ||
|
|
be7159a708 | ||
|
|
470f54ce33 | ||
|
|
4add78003a | ||
|
|
2b55572d06 | ||
|
|
9f17bc3240 | ||
|
|
ab73a93fd6 | ||
|
|
5cce810483 | ||
|
|
4f7441efd3 | ||
|
|
9f16367847 | ||
|
|
95ef2b7ef2 | ||
|
|
eb8a91cec6 | ||
|
|
d359544b30 | ||
|
|
3edfc4f504 | ||
|
|
158aeb5655 | ||
|
|
59edb6ca87 | ||
|
|
9588b6f937 | ||
|
|
de29942142 | ||
|
|
faa6b806d2 | ||
|
|
b5b005d01f | ||
|
|
4e178c8186 | ||
|
|
2c4a084cb0 | ||
|
|
8adfe7fa20 | ||
|
|
1434e0366c | ||
|
|
9690cad46a | ||
|
|
7211641370 | ||
|
|
efad90e4bc | ||
|
|
831476725e | ||
|
|
d9cf8b4f36 | ||
|
|
33cf2735cf | ||
|
|
ed3eb31d7e | ||
|
|
9eda156ea9 | ||
|
|
b9bbc83302 | ||
|
|
9a4a2b507c | ||
|
|
c2c6b051ff | ||
|
|
ee2d15aa96 | ||
|
|
f393ae5969 | ||
|
|
2a2627e8a9 | ||
|
|
dc7ea3ae8b | ||
|
|
28648770c0 | ||
|
|
a9eac8bb71 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -18,3 +18,4 @@ CPackConfig.cmake
|
||||
CPackSourceConfig.cmake
|
||||
patches
|
||||
*.exe
|
||||
tutorials
|
||||
|
||||
11
AUTHORS
11
AUTHORS
@@ -123,6 +123,10 @@ The following submitted code, packages or analysis, and deserve special thanks:
|
||||
Alan Young
|
||||
Gordon Ball
|
||||
Rafał Bolanowski
|
||||
Sunil Joshi
|
||||
Misty De Meo
|
||||
Kent R. Spillner
|
||||
Konstantin
|
||||
|
||||
Thanks to the following, who submitted detailed bug reports and excellent
|
||||
suggestions:
|
||||
@@ -277,3 +281,10 @@ suggestions:
|
||||
Ander
|
||||
Naga Kiran
|
||||
David Badura
|
||||
James Dietrich
|
||||
JDufault
|
||||
Simon Michael
|
||||
Robin Green
|
||||
pawprint
|
||||
Reg
|
||||
Yaroslav Molochko
|
||||
|
||||
@@ -7,7 +7,7 @@ include (CheckStructHasMember)
|
||||
set (HAVE_CMAKE true)
|
||||
|
||||
project (task)
|
||||
set (PROJECT_VERSION "2.5.0")
|
||||
set (PROJECT_VERSION "2.5.1")
|
||||
|
||||
OPTION (ENABLE_SYNC "Enable 'task sync' support" ON)
|
||||
|
||||
@@ -43,11 +43,14 @@ else (_HAS_CXX11)
|
||||
message (FATAL_ERROR "C++11 support missing. Try upgrading your C++ compiler. If you have a good reason for using an outdated compiler, please let us know at support@taskwarrior.org.")
|
||||
endif (_HAS_CXX11)
|
||||
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||
set (_CXX11_FLAGS "${_CXX11_FLAGS} -stdlib=libc++")
|
||||
endif (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set (LINUX true)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set (DARWIN true)
|
||||
set (_CXX11_FLAGS "${_CXX11_FLAGS} -stdlib=libc++")
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "kFreeBSD")
|
||||
set (KFREEBSD true)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
@@ -132,10 +135,10 @@ check_struct_has_member ("struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF)
|
||||
check_struct_has_member ("struct stat" st_birthtime "sys/types.h;sys/stat.h" HAVE_ST_BIRTHTIME)
|
||||
|
||||
message ("-- Looking for libuuid")
|
||||
if (DARWIN OR FREEBSD)
|
||||
if (DARWIN OR FREEBSD OR OPENBSD)
|
||||
# Apple and FreeBSD include the uuid functions in their libc, rather than libuuid
|
||||
check_function_exists (uuid_unparse_lower HAVE_UUID_UNPARSE_LOWER)
|
||||
else (DARWIN OR FREEBSD)
|
||||
else (DARWIN OR FREEBSD OR OPENBSD)
|
||||
find_path (UUID_INCLUDE_DIR uuid/uuid.h)
|
||||
find_library (UUID_LIBRARY NAMES uuid)
|
||||
if (UUID_INCLUDE_DIR AND UUID_LIBRARY)
|
||||
@@ -148,7 +151,7 @@ else (DARWIN OR FREEBSD)
|
||||
else (UUID_INCLUDE_DIR AND UUID_LIBRARY)
|
||||
message (FATAL_ERROR "-- libuuid not found.")
|
||||
endif (UUID_INCLUDE_DIR AND UUID_LIBRARY)
|
||||
endif (DARWIN OR FREEBSD)
|
||||
endif (DARWIN OR FREEBSD OR OPENBSD)
|
||||
|
||||
if (HAVE_UUID_UNPARSE_LOWER)
|
||||
message ("-- Found libuuid")
|
||||
@@ -190,7 +193,7 @@ if (EXISTS performance)
|
||||
add_subdirectory (performance EXCLUDE_FROM_ALL)
|
||||
endif (EXISTS performance)
|
||||
|
||||
set (doc_FILES NEWS ChangeLog README.md INSTALL AUTHORS COPYING)
|
||||
set (doc_FILES NEWS ChangeLog README.md INSTALL AUTHORS COPYING LICENSE)
|
||||
foreach (doc_FILE ${doc_FILES})
|
||||
install (FILES ${doc_FILE} DESTINATION ${TASK_DOCDIR})
|
||||
endforeach (doc_FILE)
|
||||
|
||||
2
COPYING
2
COPYING
@@ -1,6 +1,6 @@
|
||||
Taskwarrior - a command line task list manager.
|
||||
|
||||
Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
118
ChangeLog
118
ChangeLog
@@ -1,4 +1,116 @@
|
||||
2.5.0 (2015-10-21) -
|
||||
2.5.1 (2016-02-24) -
|
||||
|
||||
- TD-104 Unrecognized taskwarrior file format
|
||||
(thanks to Jeremy John Reeder, Reg).
|
||||
- TW-38 Dates in the far future give bad estimates in burndown
|
||||
(thanks to Ben Boeckel).
|
||||
- TW-188 short help text
|
||||
(thanks to David Patrick).
|
||||
- TW-311 Estimated completion in burndown.daily shows impossible results
|
||||
(thanks to Michele Santullo).
|
||||
- TW-1313 some recurring intervals reset due time to midnight
|
||||
(thanks to James Dietrich).
|
||||
- TW-1425 The 'age' format rounds in odd ways
|
||||
(thanks to Black Ops testing).
|
||||
- TW-1435 Ability to sync the full history of tasks including completed ones
|
||||
(thanks to Renato Alves).
|
||||
- TW-1446 Difference in how relative dates are specified in report filters since 2.3.0
|
||||
(thanks to atomicules).
|
||||
- TW-1481 Unable to assign a completed task as dependency
|
||||
(thanks to Tomas Babej).
|
||||
- TW-1500 Dates formatted as ".age", ".remaining", or ".countdown" often give
|
||||
blank results
|
||||
(thanks to Jeremy John Reeder).
|
||||
- TW-1582 Wrong urgency for first report after reviving task with
|
||||
"mod status:pending"
|
||||
- TW-1658 rc override to non-existent alternate rc quietly uses default
|
||||
(thanks to David Patrick).
|
||||
- TW-1697 Inconsistent failure mode on invalid task id
|
||||
(thanks to Daniel Shahaf).
|
||||
- TW-1698 tests: 'make test' should exit non-zero if tests failed
|
||||
(thanks to Daniel Shahaf).
|
||||
- TW-1703 When on-modify hook is installed, some messages print UUIDs instead of
|
||||
IDs
|
||||
(thanks to Robin Green).
|
||||
- TW-1704 Use Task::identifier to reference the Task in the output
|
||||
- TW-1705 Directories in .task/hooks should not be reported as invalid hooks
|
||||
(thanks to Tomas Babej).
|
||||
- TW-1709 Parsing bug when doing "task undo"
|
||||
(thanks to Scott Kostyshak).
|
||||
- TW-1710 Setting wait date on status:completed / status:deleted
|
||||
(thanks to Daniel Shahaf).
|
||||
- TW-1714 Starting recurring task starts all recurrences
|
||||
(thanks to Robin Green).
|
||||
- TW-1718 String UDA not passed through unchanged
|
||||
(thanks to Wim Schuermann).
|
||||
- TW-1719 Description cannot contain improper ordinals
|
||||
(thanks to Ben Boeckel).
|
||||
- TW-1720 CmdContext uses a mix of both throw and std::cout to convey errors
|
||||
(thanks to Paul Beckingham).
|
||||
- TW-1723 task info causes segfault
|
||||
(thanks to Roman Golovin).
|
||||
- TW-1724 some commands show color codes when redirected
|
||||
(thanks to Alan Young).
|
||||
- TW-1729 zsh completion: zregexparse:4: not enough regex argument
|
||||
(thanks to Daniel Shahaf).
|
||||
- TW-1733 taskwarrior 2.5.0 can not compile FreeBSD 10.1
|
||||
(thanks to ribbon).
|
||||
- TW-1734 calendar gives an error when context is set
|
||||
(thanks to Simon Michael).
|
||||
- TW-1735 context with no subcommand should do something
|
||||
(thanks to Simon Michael).
|
||||
- TW-1736 Error on detection of BOM in files.
|
||||
- TW-1738 add defined languages JAPANESE
|
||||
(thanks to ribbon).
|
||||
- TW-1741 Warning "ignoring return value of ‘int ftruncate" while doing make on
|
||||
xubuntu15.10
|
||||
(thanks to Sunil Joshi).
|
||||
- TW-1742 Indian Holiday Calendar (Master HolidayFile)
|
||||
(thanks to Sunil Joshi).
|
||||
- TW-1748 CMakeLists shouldn't hardcode libc++ on Darwin
|
||||
(thanks to Misty De Meo).
|
||||
- TW-1749 PATH_MAX isn't defined in FS.cpp in some versions of OS X
|
||||
(thanks to Misty De Meo).
|
||||
- TW-1750 REG_ENHANCED, used in RX.cpp, isn't defined in all versions of Darwin
|
||||
(thanks to Misty De Meo).
|
||||
- TW-1752 cleanup of diag output
|
||||
(thanks to David Patrick).
|
||||
- TW-1754 '\' at end of description in 'task edit' merges task with following task
|
||||
(thanks to Scott Kostyshak).
|
||||
- TW-1756 The columns.t unit test fails two tests after 2300 local.
|
||||
- TW-1763 Removing the due date of a task with no due date modifies the task
|
||||
(thanks to Scott Kostyshak).
|
||||
- TW-1768 Task sync failed: "Either your credentials are incorrect, or your account
|
||||
doesn't exist on the Taskserver."
|
||||
(thanks to Konstantin).
|
||||
- TW-1773 one task eaten all my RAM
|
||||
(thanks to Yaroslav Molochko).
|
||||
- Fixed broken build for Cygwin and older GCC
|
||||
(thanks to Richard Boß).
|
||||
- The default configuration is now 256-color only.
|
||||
- The 'columns' report now shows whether a column is modifiable or read only.
|
||||
- UDA indicator column did not properly default to 'U'
|
||||
(thanks to JDufault).
|
||||
- Removed task.fish arguments until TW-1404 is fixed
|
||||
(thanks to Roman Inflianskas)
|
||||
- Removed unused 'dom' and 'shell.prompt' configuration settings.
|
||||
- Numerous performance improvements. Taskwarrior 2.5.1 is between X% and
|
||||
Y% faster than 2.5.0 when running various commands.
|
||||
- New formatting specifier 'relative' for columns of Date type was introduced.
|
||||
- Fixed bug where 'rc.allow.empty.filter' was not behaving properly
|
||||
(thanks to Scott Kostyshak).
|
||||
- Fixed man page bugs
|
||||
(thanks to pawprint).
|
||||
- Improved OpenBSD support
|
||||
(thanks to Kent R. Spillner).
|
||||
- Included 'problems' script in build dir
|
||||
(thanks to Gordon Ball).
|
||||
- The 'run_all' script was not correctly using exit code 0 when all tests pass
|
||||
(thanks to Gordon Ball).
|
||||
|
||||
------ current release ---------------------------
|
||||
|
||||
2.5.0 (2015-10-21) dd5968a61b1fab258b38879cfdbb7d67f1bcd550
|
||||
|
||||
- TW-20 Task edit loses annotation precision, causing journal updating code
|
||||
to incorrectly indicate annotions are deleted and recreated (thanks
|
||||
@@ -211,7 +323,7 @@
|
||||
added.
|
||||
- When GC is turned off, disable the query shortcuts, which no longer apply.
|
||||
|
||||
------ current release ---------------------------
|
||||
------ old releases ------------------------------
|
||||
|
||||
2.4.4 (2015-05-10) df49aaba126484b668c41d3ff9301f8d8ec49987
|
||||
|
||||
@@ -232,8 +344,6 @@
|
||||
- The 'obfuscate' setting, if set to '1' will replace all text with 'xxx'.
|
||||
- POSIX file locking mechanism, eliminating platform-specific code.
|
||||
|
||||
------ old releases ------------------------------
|
||||
|
||||
2.4.3 (2015-04-19) 499044b9b6bdbc95338ea585204e949d80b24a09
|
||||
|
||||
- TW-57 user defined attribute sort order (thanks to Max Muller).
|
||||
|
||||
6
INSTALL
6
INSTALL
@@ -30,7 +30,7 @@ Briefly, these shell commands will unpack, build and install Taskwarrior:
|
||||
|
||||
$ tar xzf task-X.Y.Z.tar.gz [1]
|
||||
$ cd task-X.Y.Z [2]
|
||||
$ cmake . [3]
|
||||
$ cmake -DCMAKE_BUILD_TYPE=release . [3]
|
||||
$ make [4]
|
||||
$ sudo make install [5]
|
||||
$ cd .. ; rm -r task-X.Y.Z [6]
|
||||
@@ -43,7 +43,8 @@ These commands are explained below:
|
||||
2. Change directory to the root of the distribution.
|
||||
|
||||
3. Invokes CMake to scan for dependencies and machine-specific details, then
|
||||
generate the makefiles. This may take a minute.
|
||||
generate the makefiles. Requests an optimized build, which will run faster
|
||||
and be more compact. This may take a minute.
|
||||
|
||||
4. Builds Taskwarrior. This may take a minute.
|
||||
|
||||
@@ -119,6 +120,7 @@ Currently the defined languages are:
|
||||
por_PRT 6
|
||||
epo_RUS 7
|
||||
pol_POL 8
|
||||
jpn-JPN 9
|
||||
|
||||
|
||||
Uninstallation
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
Taskwarrior - a command line task list manager.
|
||||
|
||||
Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
63
NEWS
63
NEWS
@@ -1,56 +1,33 @@
|
||||
|
||||
New Features in Taskwarrior 2.5.0
|
||||
New Features in Taskwarrior 2.5.1
|
||||
|
||||
- The active context, if one is set, is now identified in "task context list"
|
||||
- It is an error to attempt adding or removing a virtual tag.
|
||||
- New 'UDA', 'ORPHAN', 'PROJECT', 'PRIORITY' and 'LATEST' virtual tags.
|
||||
- As a bug-fix, code cleanup and performance release, new features are
|
||||
limited to only small tweaks.
|
||||
- The 'help' command now takes a 'usage' argument, which displays only the
|
||||
command usage.
|
||||
|
||||
New Commands in Taskwarrior 2.5.0
|
||||
New Commands in Taskwarrior 2.5.1
|
||||
|
||||
- The '_unique' command shows a set of unique values for the specified
|
||||
attribute
|
||||
- The 'commands' command shows the supported commands, with additional
|
||||
details that determine some of their behavior.
|
||||
- None.
|
||||
|
||||
New Configuration Options in Taskwarrior 2.5.0
|
||||
New Configuration Options in Taskwarrior 2.5.1
|
||||
|
||||
- The 'json.depends.array' setting controls whether dependencies are exported
|
||||
as a JSON array, of a comma-separated string. Default is 'on'.
|
||||
Both variations are imported.
|
||||
- The 'color.uda.<name>.none' is a color that is applied to tasks that do
|
||||
not have a value for the UDA '<name>'.
|
||||
- A Cygwin fix means that now we can default 'search.case.sensitive' to 'yes',
|
||||
and all platforms are again equal.
|
||||
- The new 'recur' verbosity token generates a message when a recurring task is
|
||||
generated.
|
||||
- The new 'unwait' verbosity token generates a message when a waiting task
|
||||
becomes visible.
|
||||
- The new 'rule.color.merge' configuration option can disable merging of colors
|
||||
produced by different color rules. Use if your color scheme produces
|
||||
unpleasing foreground and background combinations.
|
||||
- New 'relative' column format for 'date' type columns does what 'remaining'
|
||||
and 'countdown' do, but in one format.
|
||||
|
||||
Newly Deprecated Features in Taskwarrior 2.5.0
|
||||
Newly Deprecated Features in Taskwarrior 2.5.1
|
||||
|
||||
- The '_ids', '_projects', '_tags', '_uuids' helper commands are deprecated,
|
||||
and replaced by the new '_unique' helper command.
|
||||
- Comma-separated ID lists are deprecated.
|
||||
- The 'new-uuid' verbosity token is deprecated. Its functionality will
|
||||
be merged with the 'new-id' verbosity token.
|
||||
-
|
||||
|
||||
Removed Features in 2.5.0
|
||||
Removed Features in 2.5.1
|
||||
|
||||
- The script 'context' was removed, now that context is a core feature.
|
||||
- Nonextended forms of ISO-8601 date/time support is removed. This means
|
||||
that 'YYYYMMDD' is no longer supported, but 'YYYY-MM-DD' is. For times,
|
||||
'hhmmss' is no longer supported, but 'hh:mm:ss' is. The non-extended
|
||||
forms all contain sequences of digits that make the identification of
|
||||
IDs, UUIDs, and various date/time formats ambiguous.
|
||||
- Comma-separated UUID lists are no longer supported.
|
||||
- DOM references may no longer be abbreviated.
|
||||
- The 'urgency.next.coefficient' configuration option is deprecated in favor
|
||||
of 'urgency.user.tag.next.coefficient'.
|
||||
- The long deprecated syntax of color values with underscores (i.e 'on_red')
|
||||
is no longer supported.
|
||||
- There is no longer a 16-color default configuration for some platforms,
|
||||
making all platforms 256-color.
|
||||
- The configuration setting 'burndown.bias' is no longer used.
|
||||
- The algorithm used to estimate completion on the 'burndown' reports has
|
||||
been replaced by something less icky. Estimates are now based on the net
|
||||
completion rate after the peak number of pending tasks.
|
||||
- The unused 'dom' and 'shell.prompt' configuration settings were removed.
|
||||
|
||||
Known Issues
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH task-color 5 2015-10-21 "${PACKAGE_STRING}" "User Manuals"
|
||||
.TH task-color 5 2016-02-24 "${PACKAGE_STRING}" "User Manuals"
|
||||
|
||||
.SH NAME
|
||||
task-color \- A color tutorial for the Taskwarrior command line todo manager.
|
||||
@@ -104,7 +104,7 @@ after 'on' are background.
|
||||
|
||||
There is an additional 'underline' attribute that may be used:
|
||||
|
||||
underline bright red on black
|
||||
underline bold red on black
|
||||
|
||||
And an 'inverse' attribute:
|
||||
|
||||
@@ -113,7 +113,7 @@ And an 'inverse' attribute:
|
||||
Taskwarrior has a command that helps you visualize these color combinations.
|
||||
Try this:
|
||||
|
||||
$ task color underline bright red on black
|
||||
$ task color underline bold red on black
|
||||
|
||||
You can use this command to see how the various color combinations work. You
|
||||
will also see some sample colors displayed, like the ones above, in addition to
|
||||
@@ -316,7 +316,7 @@ Better yet, create your own, and share it. We will gladly host the theme file
|
||||
on <http://taskwarrior.org>.
|
||||
|
||||
.SH "CREDITS & COPYRIGHTS"
|
||||
Copyright (C) 2006 \- 2015 P. Beckingham, F. Hernandez.
|
||||
Copyright (C) 2006 \- 2016 P. Beckingham, F. Hernandez.
|
||||
|
||||
Taskwarrior is distributed under the MIT license. See
|
||||
http://www.opensource.org/licenses/mit-license.php for more information.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH task-sync 5 2015-10-21 "${PACKAGE_STRING}" "User Manuals"
|
||||
.TH task-sync 5 2016-02-24 "${PACKAGE_STRING}" "User Manuals"
|
||||
|
||||
.SH NAME
|
||||
task-sync \- A discussion and tutorial for the various task(1) data
|
||||
@@ -143,7 +143,7 @@ Weaknesses:
|
||||
- You need to manage your own server, or gain access to a hosted server.
|
||||
|
||||
.SH "CREDITS & COPYRIGHTS"
|
||||
Copyright (C) 2006 \- 2015 P. Beckingham, F. Hernandez.
|
||||
Copyright (C) 2006 \- 2016 P. Beckingham, F. Hernandez.
|
||||
|
||||
Taskwarrior is distributed under the MIT license. See
|
||||
http://www.opensource.org/licenses/mit-license.php for more information.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH task 1 2015-10-21 "${PACKAGE_STRING}" "User Manuals"
|
||||
.TH task 1 2016-02-24 "${PACKAGE_STRING}" "User Manuals"
|
||||
|
||||
.SH NAME
|
||||
task \- A command line todo manager.
|
||||
@@ -1120,7 +1120,7 @@ To unset any context, use the 'none' subcommand.
|
||||
Context can be defined using the 'define' subcommand, specifying both the name
|
||||
of the new context, and it's assigned filter.
|
||||
|
||||
$ task context define home
|
||||
$ task context define home project:Home
|
||||
Are you sure you want to add 'context.home' with a value of 'project:Home'? (yes/no) yes
|
||||
Context 'home' successfully defined.
|
||||
|
||||
@@ -1212,6 +1212,9 @@ intact, so you can use:
|
||||
$ task add project:\\'Three Word Project\\' description
|
||||
.RE
|
||||
|
||||
Taskwarrior supports Unicode using only the UTF8 encoding, with no Byte Order
|
||||
Marks in the data files.
|
||||
|
||||
.SH CONFIGURATION FILE AND OVERRIDE OPTIONS
|
||||
Taskwarrior stores its configuration in a file in the user's home directory:
|
||||
~/.taskrc. The default configuration file can be overridden with:
|
||||
@@ -1272,7 +1275,7 @@ The file that contains the completed ("done") tasks.
|
||||
The file that contains information needed by the "undo" command.
|
||||
|
||||
.SH "CREDITS & COPYRIGHTS"
|
||||
Copyright (C) 2006 \- 2015 P. Beckingham, F. Hernandez.
|
||||
Copyright (C) 2006 \- 2016 P. Beckingham, F. Hernandez.
|
||||
|
||||
Taskwarrior is distributed under the MIT license. See
|
||||
http://www.opensource.org/licenses/mit-license.php for more information.
|
||||
@@ -1299,5 +1302,5 @@ You can contact the project by emailing
|
||||
.SH REPORTING BUGS
|
||||
.TP
|
||||
Bugs in Taskwarrior may be reported to the issue-tracker at
|
||||
<http://taskwarrior.org>
|
||||
<https://bug.tasktools.org/>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH taskrc 5 2015-10-21 "${PACKAGE_STRING}" "User Manuals"
|
||||
.TH taskrc 5 2016-02-24 "${PACKAGE_STRING}" "User Manuals"
|
||||
|
||||
.SH NAME
|
||||
taskrc \- Configuration details for the task(1) command
|
||||
@@ -391,11 +391,6 @@ Sets the xterm window title when reports are run. Defaults to off.
|
||||
Sets a preference for infix expressions (1 + 2) or postfix expressions (1 2 +).
|
||||
Defaults to infix.
|
||||
|
||||
.TP
|
||||
.B dom=on
|
||||
Enables or disables access to Taskwarrior internals and task metadata on the
|
||||
command line. Defaults to on.
|
||||
|
||||
.TP
|
||||
.B json.array=on
|
||||
Determines whether the export command encloses the JSON output in '[...]' and
|
||||
@@ -473,16 +468,6 @@ comparison of the data. This can be in either the 'side' style, which compares
|
||||
values side-by-side in a table, or 'diff' style, which uses a format similar to
|
||||
the 'diff' command.
|
||||
|
||||
.TP
|
||||
.B burndown.bias=0.666
|
||||
The burndown bias is a number that lies within the range 0 <= bias <= 1. The bias
|
||||
is the fraction of the find/fix rates derived from the short-term data (last
|
||||
25% of the report) versus the longer term data (last 50% of the report). A
|
||||
value of 0.666 (the default) means that the short-term rate has twice the weight
|
||||
of the longer-term rate. The calculation is as follows:
|
||||
|
||||
rate = (long-term-rate * (1 - bias)) + (short-term-rate * bias)
|
||||
|
||||
.TP
|
||||
.B abbreviation.minimum=2
|
||||
Minimum length of any abbreviated command/value. This means that "ve", "ver",
|
||||
@@ -548,7 +533,7 @@ the 'history' report, for example, or 'export'.
|
||||
.B report.X.dateformat=Y-M-D
|
||||
This is a string of characters that defines how Taskwarrior formats date values.
|
||||
The precedence order for the configuration variable is report.X.dateformat then
|
||||
dateformat.report then dateformat for formating the due dates in reports.
|
||||
dateformat.report then dateformat for formatting the due dates in reports.
|
||||
If both report.X.dateformat and dateformat.report are not set then dateformat
|
||||
will be applied
|
||||
to the date. Entered dates as well as all other displayed dates in reports
|
||||
@@ -763,7 +748,7 @@ variable.
|
||||
|
||||
.RS
|
||||
The following holidays are computed automatically: Good Friday (goodfriday),
|
||||
Easter (easter), Easter monday (eastermonday), Ascension (ascension), Pentecost
|
||||
Easter (easter), Easter Monday (eastermonday), Ascension (ascension), Pentecost
|
||||
(pentecost). The date for these holidays is the given keyword:
|
||||
.RE
|
||||
|
||||
@@ -937,10 +922,15 @@ Colors any task that does not have the user defined attribute X.
|
||||
.RE
|
||||
|
||||
.TP
|
||||
.B color.error=green
|
||||
.B color.error=white on red
|
||||
Colors any of the error messages.
|
||||
.RE
|
||||
|
||||
.TP
|
||||
.B color.warning=bold red
|
||||
Colors any of the warning messages.
|
||||
.RE
|
||||
|
||||
.TP
|
||||
.B color.header=green
|
||||
Colors any of the messages printed prior to the report output.
|
||||
@@ -1498,7 +1488,7 @@ Default is "NORMAL". See GnuTLS documentation for full details.
|
||||
.RE
|
||||
|
||||
.SH "CREDITS & COPYRIGHTS"
|
||||
Copyright (C) 2006 \- 2015 P. Beckingham, F. Hernandez.
|
||||
Copyright (C) 2006 \- 2016 P. Beckingham, F. Hernandez.
|
||||
|
||||
This man page was originally written by Federico Hernandez.
|
||||
|
||||
@@ -1527,5 +1517,5 @@ You can contact the project by emailing
|
||||
.SH REPORTING BUGS
|
||||
.TP
|
||||
Bugs in Taskwarrior may be reported to the issue-tracker at
|
||||
<http://taskwarrior.org>
|
||||
<https://bug.tasktools.org/>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -32,7 +32,7 @@ color.label.sort=
|
||||
color.alternate=on gray2
|
||||
color.header=gray10
|
||||
color.footnote=gray10
|
||||
color.warning=
|
||||
color.warning=white on blue
|
||||
color.error=white on red
|
||||
color.debug=blue
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -32,7 +32,7 @@ color.label.sort=
|
||||
color.alternate=on gray2
|
||||
color.header=rgb013
|
||||
color.footnote=rgb013
|
||||
color.warning=
|
||||
color.warning=white on rgb103
|
||||
color.error=white on red
|
||||
color.debug=blue
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -32,7 +32,7 @@ color.label.sort=
|
||||
color.alternate=on gray2
|
||||
color.header=rgb031
|
||||
color.footnote=rgb031
|
||||
color.warning=
|
||||
color.warning=black on yellow
|
||||
color.error=white on red
|
||||
color.debug=blue
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/be-BY/2015.json
|
||||
# http://holidata.net/be-BY/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/cs-CZ/2015.json
|
||||
# http://holidata.net/cs-CZ/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/da-DK/2015.json
|
||||
# http://holidata.net/da-DK/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/de-AT/2015.json
|
||||
# http://holidata.net/de-AT/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -57,65 +57,69 @@ holiday.de-AT14.name=Rupert (S)
|
||||
holiday.de-AT14.date=20150924
|
||||
holiday.de-AT15.name=Tag der Volksabstimmung (K)
|
||||
holiday.de-AT15.date=20151010
|
||||
holiday.de-AT16.name=Allerheiligen
|
||||
holiday.de-AT16.date=20151101
|
||||
holiday.de-AT17.name=Martin (B)
|
||||
holiday.de-AT17.date=20151111
|
||||
holiday.de-AT18.name=Leopold (W, N)
|
||||
holiday.de-AT18.date=20151115
|
||||
holiday.de-AT19.name=Mariä Empfängnis
|
||||
holiday.de-AT19.date=20151208
|
||||
holiday.de-AT20.name=Heiliger Abend
|
||||
holiday.de-AT20.date=20151224
|
||||
holiday.de-AT21.name=Christtag
|
||||
holiday.de-AT21.date=20151225
|
||||
holiday.de-AT22.name=Stefanitag
|
||||
holiday.de-AT22.date=20151226
|
||||
holiday.de-AT23.name=Silvester
|
||||
holiday.de-AT23.date=20151231
|
||||
holiday.de-AT24.name=Neujahr
|
||||
holiday.de-AT24.date=20160101
|
||||
holiday.de-AT25.name=Heilige drei Könige
|
||||
holiday.de-AT25.date=20160106
|
||||
holiday.de-AT26.name=Josef (K, St, T, V)
|
||||
holiday.de-AT26.date=20160319
|
||||
holiday.de-AT27.name=Karfreitag
|
||||
holiday.de-AT27.date=20160325
|
||||
holiday.de-AT28.name=Ostersonntag
|
||||
holiday.de-AT28.date=20160327
|
||||
holiday.de-AT29.name=Ostermontag
|
||||
holiday.de-AT29.date=20160328
|
||||
holiday.de-AT30.name=Staatsfeiertag
|
||||
holiday.de-AT30.date=20160501
|
||||
holiday.de-AT31.name=Florian (O)
|
||||
holiday.de-AT31.date=20160504
|
||||
holiday.de-AT32.name=Christi Himmelfahrt
|
||||
holiday.de-AT32.date=20160505
|
||||
holiday.de-AT33.name=Pfingstsonntag
|
||||
holiday.de-AT33.date=20160515
|
||||
holiday.de-AT34.name=Pfingstmontag
|
||||
holiday.de-AT34.date=20160516
|
||||
holiday.de-AT35.name=Fronleichnam
|
||||
holiday.de-AT35.date=20160526
|
||||
holiday.de-AT36.name=Mariä Himmelfahrt
|
||||
holiday.de-AT36.date=20160815
|
||||
holiday.de-AT37.name=Rupert (S)
|
||||
holiday.de-AT37.date=20160924
|
||||
holiday.de-AT38.name=Tag der Volksabstimmung (K)
|
||||
holiday.de-AT38.date=20161010
|
||||
holiday.de-AT39.name=Allerheiligen
|
||||
holiday.de-AT39.date=20161101
|
||||
holiday.de-AT40.name=Martin (B)
|
||||
holiday.de-AT40.date=20161111
|
||||
holiday.de-AT41.name=Leopold (W, N)
|
||||
holiday.de-AT41.date=20161115
|
||||
holiday.de-AT42.name=Mariä Empfängnis
|
||||
holiday.de-AT42.date=20161208
|
||||
holiday.de-AT43.name=Heiliger Abend
|
||||
holiday.de-AT43.date=20161224
|
||||
holiday.de-AT44.name=Christtag
|
||||
holiday.de-AT44.date=20161225
|
||||
holiday.de-AT45.name=Stefanitag
|
||||
holiday.de-AT45.date=20161226
|
||||
holiday.de-AT46.name=Silvester
|
||||
holiday.de-AT46.date=20161231
|
||||
holiday.de-AT16.name=Nationalfeiertag
|
||||
holiday.de-AT16.date=20151026
|
||||
holiday.de-AT17.name=Allerheiligen
|
||||
holiday.de-AT17.date=20151101
|
||||
holiday.de-AT18.name=Martin (B)
|
||||
holiday.de-AT18.date=20151111
|
||||
holiday.de-AT19.name=Leopold (W, N)
|
||||
holiday.de-AT19.date=20151115
|
||||
holiday.de-AT20.name=Mariä Empfängnis
|
||||
holiday.de-AT20.date=20151208
|
||||
holiday.de-AT21.name=Heiliger Abend
|
||||
holiday.de-AT21.date=20151224
|
||||
holiday.de-AT22.name=Christtag
|
||||
holiday.de-AT22.date=20151225
|
||||
holiday.de-AT23.name=Stefanitag
|
||||
holiday.de-AT23.date=20151226
|
||||
holiday.de-AT24.name=Silvester
|
||||
holiday.de-AT24.date=20151231
|
||||
holiday.de-AT25.name=Neujahr
|
||||
holiday.de-AT25.date=20160101
|
||||
holiday.de-AT26.name=Heilige drei Könige
|
||||
holiday.de-AT26.date=20160106
|
||||
holiday.de-AT27.name=Josef (K, St, T, V)
|
||||
holiday.de-AT27.date=20160319
|
||||
holiday.de-AT28.name=Karfreitag
|
||||
holiday.de-AT28.date=20160325
|
||||
holiday.de-AT29.name=Ostersonntag
|
||||
holiday.de-AT29.date=20160327
|
||||
holiday.de-AT30.name=Ostermontag
|
||||
holiday.de-AT30.date=20160328
|
||||
holiday.de-AT31.name=Staatsfeiertag
|
||||
holiday.de-AT31.date=20160501
|
||||
holiday.de-AT32.name=Florian (O)
|
||||
holiday.de-AT32.date=20160504
|
||||
holiday.de-AT33.name=Christi Himmelfahrt
|
||||
holiday.de-AT33.date=20160505
|
||||
holiday.de-AT34.name=Pfingstsonntag
|
||||
holiday.de-AT34.date=20160515
|
||||
holiday.de-AT35.name=Pfingstmontag
|
||||
holiday.de-AT35.date=20160516
|
||||
holiday.de-AT36.name=Fronleichnam
|
||||
holiday.de-AT36.date=20160526
|
||||
holiday.de-AT37.name=Mariä Himmelfahrt
|
||||
holiday.de-AT37.date=20160815
|
||||
holiday.de-AT38.name=Rupert (S)
|
||||
holiday.de-AT38.date=20160924
|
||||
holiday.de-AT39.name=Tag der Volksabstimmung (K)
|
||||
holiday.de-AT39.date=20161010
|
||||
holiday.de-AT40.name=Nationalfeiertag
|
||||
holiday.de-AT40.date=20161026
|
||||
holiday.de-AT41.name=Allerheiligen
|
||||
holiday.de-AT41.date=20161101
|
||||
holiday.de-AT42.name=Martin (B)
|
||||
holiday.de-AT42.date=20161111
|
||||
holiday.de-AT43.name=Leopold (W, N)
|
||||
holiday.de-AT43.date=20161115
|
||||
holiday.de-AT44.name=Mariä Empfängnis
|
||||
holiday.de-AT44.date=20161208
|
||||
holiday.de-AT45.name=Heiliger Abend
|
||||
holiday.de-AT45.date=20161224
|
||||
holiday.de-AT46.name=Christtag
|
||||
holiday.de-AT46.date=20161225
|
||||
holiday.de-AT47.name=Stefanitag
|
||||
holiday.de-AT47.date=20161226
|
||||
holiday.de-AT48.name=Silvester
|
||||
holiday.de-AT48.date=20161231
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/de-BE/2015.json
|
||||
# http://holidata.net/de-BE/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/de-CH/2015.json
|
||||
# http://holidata.net/de-CH/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/de-DE/2015.json
|
||||
# http://holidata.net/de-DE/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -55,7 +55,7 @@ holiday.de-DE13.name=Reformationstag
|
||||
holiday.de-DE13.date=20151031
|
||||
holiday.de-DE14.name=Allerheiligen
|
||||
holiday.de-DE14.date=20151101
|
||||
holiday.de-DE15.name=Buss und Bettag
|
||||
holiday.de-DE15.name=Buß- und Bettag
|
||||
holiday.de-DE15.date=20151118
|
||||
holiday.de-DE16.name=Heilig Abend
|
||||
holiday.de-DE16.date=20151224
|
||||
@@ -63,7 +63,7 @@ holiday.de-DE17.name=Weihnachtstag
|
||||
holiday.de-DE17.date=20151225
|
||||
holiday.de-DE18.name=Zweiter Weihnachtstag
|
||||
holiday.de-DE18.date=20151226
|
||||
holiday.de-DE19.name=Sylvester
|
||||
holiday.de-DE19.name=Silvester
|
||||
holiday.de-DE19.date=20151231
|
||||
holiday.de-DE20.name=Neujahr
|
||||
holiday.de-DE20.date=20160101
|
||||
@@ -93,7 +93,7 @@ holiday.de-DE32.name=Reformationstag
|
||||
holiday.de-DE32.date=20161031
|
||||
holiday.de-DE33.name=Allerheiligen
|
||||
holiday.de-DE33.date=20161101
|
||||
holiday.de-DE34.name=Buss und Bettag
|
||||
holiday.de-DE34.name=Buß- und Bettag
|
||||
holiday.de-DE34.date=20161116
|
||||
holiday.de-DE35.name=Heilig Abend
|
||||
holiday.de-DE35.date=20161224
|
||||
@@ -101,5 +101,5 @@ holiday.de-DE36.name=Weihnachtstag
|
||||
holiday.de-DE36.date=20161225
|
||||
holiday.de-DE37.name=Zweiter Weihnachtstag
|
||||
holiday.de-DE37.date=20161226
|
||||
holiday.de-DE38.name=Sylvester
|
||||
holiday.de-DE38.name=Silvester
|
||||
holiday.de-DE38.date=20161231
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/el-GR/2015.json
|
||||
# http://holidata.net/el-GR/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/en-AU/2015.json
|
||||
# http://holidata.net/en-AU/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/en-CA/2015.json
|
||||
# http://holidata.net/en-CA/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/en-GB/2015.json
|
||||
# http://holidata.net/en-GB/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/en-GL/2015.json
|
||||
# http://holidata.net/en-GL/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/en-HK/2015.json
|
||||
# http://holidata.net/en-HK/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
103
doc/rc/holidays.en-IN.rc
Normal file
103
doc/rc/holidays.en-IN.rc
Normal file
@@ -0,0 +1,103 @@
|
||||
###############################################################################
|
||||
# International Holiday Data provided by Holidata.net
|
||||
# http://holidata.net/en-IN/2015.json
|
||||
# http://holidata.net/en-IN/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
#
|
||||
# http://www.opensource.org/licenses/mit-license.php
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
holiday.en-IN1.name=New Year's Day
|
||||
holiday.en-IN1.date=20160101
|
||||
holiday.en-IN2.name=Lohri
|
||||
holiday.en-IN2.date=20160114
|
||||
holiday.en-IN3.name=Pongal, Makar Sankranti
|
||||
holiday.en-IN3.date=20160115
|
||||
holiday.en-IN4.name=Guru Gobind Singh Jayanti
|
||||
holiday.en-IN4.date=20160116
|
||||
holiday.en-IN5.name=Republic Day
|
||||
holiday.en-IN5.date=20160126
|
||||
holiday.en-IN6.name=Vasant Panchami
|
||||
holiday.en-IN6.date=20160212
|
||||
holiday.en-IN7.name=Guru Ravidas Jayanti
|
||||
holiday.en-IN7.date=20160222
|
||||
holiday.en-IN8.name=Maha Shivaratri
|
||||
holiday.en-IN8.date=20160307
|
||||
holiday.en-IN9.name=Chhoti Holi, Holika Dahan
|
||||
holiday.en-IN9.date=20160323
|
||||
holiday.en-IN10.name=Holi
|
||||
holiday.en-IN10.date=20160324
|
||||
holiday.en-IN11.name=Good Friday
|
||||
holiday.en-IN11.date=20160325
|
||||
holiday.en-IN12.name=Easter
|
||||
holiday.en-IN12.date=20160327
|
||||
holiday.en-IN13.name=Gudi Padwa, Ugadi
|
||||
holiday.en-IN13.date=20160408
|
||||
holiday.en-IN14.name=Solar New Year, Baisakhi
|
||||
holiday.en-IN14.date=20160413
|
||||
holiday.en-IN15.name=Rama Navami
|
||||
holiday.en-IN15.date=20160415
|
||||
holiday.en-IN16.name=Hazarat Ali's Birthday
|
||||
holiday.en-IN16.date=20160421
|
||||
holiday.en-IN17.name=Buddha Purnima
|
||||
holiday.en-IN17.date=20160521
|
||||
holiday.en-IN18.name=Eid al-Fitr , Ramadan
|
||||
holiday.en-IN18.date=20160707
|
||||
holiday.en-IN19.name=Independence Day
|
||||
holiday.en-IN19.date=20160815
|
||||
holiday.en-IN20.name=Rakhi, Raksha Bandhan
|
||||
holiday.en-IN20.date=20160818
|
||||
holiday.en-IN21.name=Krishna Janmashtami
|
||||
holiday.en-IN21.date=20160825
|
||||
holiday.en-IN22.name=Ganesh Chaturthi
|
||||
holiday.en-IN22.date=20160905
|
||||
holiday.en-IN23.name=Onam, Eid al-Adha, Bakrid
|
||||
holiday.en-IN23.date=20160913
|
||||
holiday.en-IN24.name=Gandhi Jayanti
|
||||
holiday.en-IN24.date=20161002
|
||||
holiday.en-IN25.name=Durga Ashtami
|
||||
holiday.en-IN25.date=20161009
|
||||
holiday.en-IN26.name=Maha Navami
|
||||
holiday.en-IN26.date=20161010
|
||||
holiday.en-IN27.name=Dussehra, Madhvacharya Jayanti
|
||||
holiday.en-IN27.date=20161011
|
||||
holiday.en-IN28.name=Muharram
|
||||
holiday.en-IN28.date=20161012
|
||||
holiday.en-IN29.name=Valmiki Jayanti
|
||||
holiday.en-IN29.date=20161016
|
||||
holiday.en-IN30.name=Karwa Chauth
|
||||
holiday.en-IN30.date=20161019
|
||||
holiday.en-IN31.name=Diwali, Lakshmi Puja
|
||||
holiday.en-IN31.date=20161030
|
||||
holiday.en-IN32.name=Gowardhan Puja
|
||||
holiday.en-IN32.date=20161031
|
||||
holiday.en-IN33.name=Bhaiya Dooj
|
||||
holiday.en-IN33.date=20161101
|
||||
holiday.en-IN34.name=Chhath Puja
|
||||
holiday.en-IN34.date=20161106
|
||||
holiday.en-IN35.name=Guru Nanak Jayanti, Nehru Jayanti
|
||||
holiday.en-IN35.date=20161114
|
||||
holiday.en-IN36.name=Milad an-Nabi, Id-e-Milad
|
||||
holiday.en-IN36.date=20161212
|
||||
holiday.en-IN37.name=Christmas
|
||||
holiday.en-IN37.date=20161225
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/en-NZ/2015.json
|
||||
# http://holidata.net/en-NZ/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/en-US/2015.json
|
||||
# http://holidata.net/en-US/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/en-ZA/2015.json
|
||||
# http://holidata.net/en-ZA/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/es-CO/2015.json
|
||||
# http://holidata.net/es-CO/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/es-EC/2015.json
|
||||
# http://holidata.net/es-EC/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/es-ES/2015.json
|
||||
# http://holidata.net/es-ES/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/es-MX/2015.json
|
||||
# http://holidata.net/es-MX/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/es-US/2015.json
|
||||
# http://holidata.net/es-US/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/et-EE/2015.json
|
||||
# http://holidata.net/et-EE/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/fi-FI/2015.json
|
||||
# http://holidata.net/fi-FI/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/fr-BE/2015.json
|
||||
# http://holidata.net/fr-BE/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/fr-FR/2015.json
|
||||
# http://holidata.net/fr-FR/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/ga-IE/2015.json
|
||||
# http://holidata.net/ga-IE/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/hr-HR/2015.json
|
||||
# http://holidata.net/hr-HR/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/is-IS/2015.json
|
||||
# http://holidata.net/is-IS/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/it-IT/2015.json
|
||||
# http://holidata.net/it-IT/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/jp-JP/2015.json
|
||||
# http://holidata.net/jp-JP/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/lt-LT/2015.json
|
||||
# http://holidata.net/lt-LT/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -46,7 +46,7 @@ holiday.lt-LT8.date=20150706
|
||||
holiday.lt-LT9.name=Žolinė
|
||||
holiday.lt-LT9.date=20150815
|
||||
holiday.lt-LT10.name=Visų šventųjų diena
|
||||
holiday.lt-LT10.date=20152101
|
||||
holiday.lt-LT10.date=20151101
|
||||
holiday.lt-LT11.name=Šv. Kalėdos
|
||||
holiday.lt-LT11.date=20151224
|
||||
holiday.lt-LT12.name=Šv. Kalėdos
|
||||
@@ -72,7 +72,7 @@ holiday.lt-LT21.date=20160706
|
||||
holiday.lt-LT22.name=Žolinė
|
||||
holiday.lt-LT22.date=20160815
|
||||
holiday.lt-LT23.name=Visų šventųjų diena
|
||||
holiday.lt-LT23.date=20162101
|
||||
holiday.lt-LT23.date=20161101
|
||||
holiday.lt-LT24.name=Šv. Kalėdos
|
||||
holiday.lt-LT24.date=20161224
|
||||
holiday.lt-LT25.name=Šv. Kalėdos
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/lv-LV/2015.json
|
||||
# http://holidata.net/lv-LV/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/nb-NO/2015.json
|
||||
# http://holidata.net/nb-NO/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/nb-SJ/2015.json
|
||||
# http://holidata.net/nb-SJ/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/nl-BE/2015.json
|
||||
# http://holidata.net/nl-BE/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/nl-NL/2015.json
|
||||
# http://holidata.net/nl-NL/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/pl-PL/2015.json
|
||||
# http://holidata.net/pl-PL/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/pt-BR/2015.json
|
||||
# http://holidata.net/pt-BR/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/pt-PT/2015.json
|
||||
# http://holidata.net/pt-PT/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/ru-RU/2015.json
|
||||
# http://holidata.net/ru-RU/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -34,7 +34,7 @@ holiday.ru-RU2.date=20150107
|
||||
holiday.ru-RU3.name=День защитника Отечества
|
||||
holiday.ru-RU3.date=20150223
|
||||
holiday.ru-RU4.name=Международный женский день
|
||||
holiday.ru-RU4.date=20150803
|
||||
holiday.ru-RU4.date=20150308
|
||||
holiday.ru-RU5.name=Пасха
|
||||
holiday.ru-RU5.date=20150412
|
||||
holiday.ru-RU6.name=Праздник весны и труда
|
||||
@@ -52,7 +52,7 @@ holiday.ru-RU11.date=20160107
|
||||
holiday.ru-RU12.name=День защитника Отечества
|
||||
holiday.ru-RU12.date=20160223
|
||||
holiday.ru-RU13.name=Международный женский день
|
||||
holiday.ru-RU13.date=20160803
|
||||
holiday.ru-RU13.date=20160308
|
||||
holiday.ru-RU14.name=Пасха
|
||||
holiday.ru-RU14.date=20160501
|
||||
holiday.ru-RU15.name=Праздник весны и труда
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/sv-SE/2015.json
|
||||
# http://holidata.net/sv-SE/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# http://holidata.net/tr-TR/2015.json
|
||||
# http://holidata.net/tr-TR/2016.json
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -49,7 +49,7 @@ color.label.sort=
|
||||
color.alternate=on color0
|
||||
color.header=color4
|
||||
color.footnote=color6
|
||||
color.warning=
|
||||
color.warning=color0 on color3
|
||||
color.error=color6
|
||||
color.debug=color6
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -49,7 +49,7 @@ color.label.sort=
|
||||
color.alternate=on color7
|
||||
color.header=color2
|
||||
color.footnote=color2
|
||||
color.warning=
|
||||
color.warning=color7 on color3
|
||||
color.error=color2
|
||||
color.debug=color3
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
86
performance/compare_runs.py
Executable file
86
performance/compare_runs.py
Executable file
@@ -0,0 +1,86 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Compare performance of two Taskwarrior versions.
|
||||
#
|
||||
# Run without arguments for usage information.
|
||||
#
|
||||
# "Perf task" lines in debug output differing between the two versions is
|
||||
# poorly handled, if at all. Best used for comparing performance between two
|
||||
# similar Taskwarrior versions only differing in performance related code.
|
||||
#
|
||||
# "total" will probably not be the sum of the shown individual parts, but
|
||||
# slightly larger since not all minimum values will have been present in the
|
||||
# same run.
|
||||
#
|
||||
|
||||
import collections
|
||||
import re
|
||||
import sys
|
||||
|
||||
# Adjust if more performance tests are added
|
||||
COMMANDS = "next list all add export import".split()
|
||||
|
||||
TaskPerf = collections.namedtuple("TaskPerf", "version commit at timing")
|
||||
|
||||
|
||||
def parse_perf(input):
|
||||
tests = {}
|
||||
for command in COMMANDS:
|
||||
tests[command] = []
|
||||
|
||||
# Parse concatenated run_perf output
|
||||
for i in re.findall("^ - task %s\.\.\.\n"
|
||||
"Perf task ([^ ]+) ([^ ]+) ([^ ]+) (.+)$"
|
||||
% command, input, re.MULTILINE):
|
||||
info = i[0:3] + ({k:v for k, v in (i.split(":") for i in i[-1].split())},)
|
||||
pt = TaskPerf(*info)
|
||||
tests[command].append(pt)
|
||||
return tests
|
||||
|
||||
|
||||
def get_best(tests):
|
||||
best = {}
|
||||
for command in tests:
|
||||
best[command] = {}
|
||||
for k in tests[command][0].timing:
|
||||
best[command][k] = str(min(int(t.timing[k]) for t in tests[command]))
|
||||
return best
|
||||
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
print("Usage:")
|
||||
print(" $ %s file1 file2" % sys.argv[0])
|
||||
print("Where file1, file2 are generated as such:")
|
||||
print(" $ for i in `seq 20`; do ./run_perf >> filename 2>&1; done")
|
||||
sys.exit(1)
|
||||
|
||||
with open(sys.argv[1], "r") as fh:
|
||||
tests_prev = parse_perf(fh.read())
|
||||
best_prev = get_best(tests_prev)
|
||||
with open(sys.argv[2], "r") as fh:
|
||||
tests_cur = parse_perf(fh.read())
|
||||
best_cur = get_best(tests_cur)
|
||||
|
||||
print("Previous: %s (%s)" % (tests_prev[COMMANDS[0]][0].version, tests_prev[COMMANDS[0]][0].commit))
|
||||
print("Current: %s (%s)" % (tests_cur[COMMANDS[0]][0].version, tests_cur[COMMANDS[0]][0].commit))
|
||||
|
||||
for test in COMMANDS:
|
||||
print("# %s:" % test)
|
||||
|
||||
out = ["" for i in range(5)]
|
||||
for k in sorted(best_prev[test].keys()):
|
||||
diff = str(int(best_cur[test][k]) - int(best_prev[test][k]))
|
||||
|
||||
if float(best_prev[test][k]) > 0:
|
||||
percentage = str(int((float(diff) / float(best_prev[test][k]) * 100))) + "%"
|
||||
else:
|
||||
percentage = "0%"
|
||||
|
||||
pad = max(map(len, (k, best_prev[test][k], best_cur[test][k], diff, percentage)))
|
||||
out[0] += " %s" % k.rjust(pad)
|
||||
out[1] += " %s" % best_prev[test][k].rjust(pad)
|
||||
out[2] += " %s" % best_cur[test][k].rjust(pad)
|
||||
out[3] += " %s" % diff.rjust(pad)
|
||||
out[4] += " %s" % percentage.rjust(pad)
|
||||
for line in out:
|
||||
print(line)
|
||||
@@ -13,9 +13,11 @@ else
|
||||
cp *.data perf.rc data
|
||||
fi
|
||||
|
||||
#TASK=/usr/local/bin/tw244
|
||||
#TASK=/usr/local/bin/tw250b1
|
||||
TASK=../src/task
|
||||
# Allow override.
|
||||
if [[ -z $TASK ]]
|
||||
then
|
||||
TASK=../src/task
|
||||
fi
|
||||
|
||||
# Run benchmarks.
|
||||
# Note that commands are run twice - warm cache testing.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#! /usr/bin/perl
|
||||
################################################################################
|
||||
##
|
||||
## Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
## Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
##
|
||||
## Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
## of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -189,7 +189,7 @@ if (open my $fh, '>:utf8', $file)
|
||||
"# ${url_current}\n",
|
||||
"# ${url_next}\n",
|
||||
"#\n",
|
||||
"# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.\n",
|
||||
"# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.\n",
|
||||
"#\n",
|
||||
"# Permission is hereby granted, free of charge, to any person obtaining a copy\n",
|
||||
"# of this software and associated documentation files (the \"Software\"), to deal\n",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
# set -g task_complete_attribute_modifiers yes
|
||||
#
|
||||
#
|
||||
# Copyright 2014 - 2015, Roman Inflianskas <infroma@gmail.com>
|
||||
# Copyright 2014 - 2016, Roman Inflianskas <infroma@gmail.com>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -179,7 +179,9 @@ function __fish.task.list.attr_value_by_name
|
||||
end
|
||||
|
||||
function __fish.task.list._command
|
||||
__fish.task.zsh commands $argv
|
||||
# Removed args until TW-1404 is fixed.
|
||||
#__fish.task.zsh commands $argv
|
||||
__fish.task.zsh commands
|
||||
end
|
||||
|
||||
function __fish.task.list.command
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python2.7
|
||||
################################################################################
|
||||
##
|
||||
## Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
## Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
##
|
||||
## Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
## of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -53,7 +53,7 @@ You should then be ready to go.
|
||||
---
|
||||
All four above mentioned files are
|
||||
|
||||
Copyright 2009 - 2015 John Florian
|
||||
Copyright 2009 - 2016 John Florian
|
||||
|
||||
and are available under the MIT license.
|
||||
For the full text of this license, see COPYING.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
" Maintainer: John Florian <jflorian@doubledog.org>
|
||||
" Updated: Thu Dec 10 18:28:26 EST 2009
|
||||
"
|
||||
" Copyright 2009 - 2015 John Florian
|
||||
" Copyright 2009 - 2016 John Florian
|
||||
"
|
||||
" This file is available under the MIT license.
|
||||
" For the full text of this license, see COPYING.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: John Florian <jflorian@doubledog.org>
|
||||
" Updated: Wed Jul 8 19:46:20 EDT 2009
|
||||
"
|
||||
" Copyright 2009 - 2015 John Florian
|
||||
" Copyright 2009 - 2016 John Florian
|
||||
"
|
||||
" This file is available under the MIT license.
|
||||
" For the full text of this license, see COPYING.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: John Florian <jflorian@doubledog.org>
|
||||
" Updated: Wed Jul 8 19:46:32 EDT 2009
|
||||
"
|
||||
" Copyright 2009 - 2015 John Florian
|
||||
" Copyright 2009 - 2016 John Florian
|
||||
"
|
||||
" This file is available under the MIT license.
|
||||
" For the full text of this license, see COPYING.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim syntax file
|
||||
"
|
||||
" Copyright (c) 2014 - 2015 Taskwarrior Team
|
||||
" Copyright (c) 2014 - 2016 Taskwarrior Team
|
||||
" Copyright (c) 2009 - 2014 John Florian
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -40,7 +40,6 @@ syn match taskrcGoodKey '^\s*\Vactive.indicator='he=e-1
|
||||
syn match taskrcGoodKey '^\s*\Valias.\S\{-}='he=e-1
|
||||
syn match taskrcGoodKey '^\s*\Vavoidlastcolumn='he=e-1
|
||||
syn match taskrcGoodKey '^\s*\Vbulk='he=e-1
|
||||
syn match taskrcGoodKey '^\s*\Vburndown.bias='he=e-1
|
||||
syn match taskrcGoodKey '^\s*\Vcalendar.details='he=e-1
|
||||
syn match taskrcGoodKey '^\s*\Vcalendar.details.report='he=e-1
|
||||
syn match taskrcGoodKey '^\s*\Vcalendar.holidays='he=e-1
|
||||
@@ -139,7 +138,6 @@ syn match taskrcGoodKey '^\s*\Vreserved.lines='he=e-1
|
||||
syn match taskrcGoodKey '^\s*\Vrow.padding='he=e-1
|
||||
syn match taskrcGoodKey '^\s*\Vrule.precedence.color='he=e-1
|
||||
syn match taskrcGoodKey '^\s*\Vsearch.case.sensitive='he=e-1
|
||||
syn match taskrcGoodKey '^\s*\Vshell.prompt='he=e-1
|
||||
syn match taskrcGoodKey '^\s*\Vtag.indicator='he=e-1
|
||||
syn match taskrcGoodKey '^\s*\Vtaskd.\(server\|credentials\|certificate\|key\|ca\|trust\|ciphers\)='he=e-1
|
||||
syn match taskrcGoodKey '^\s*\Vuda.\S\{-}.\(default\|type\|label\|values\)='he=e-1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#compdef task
|
||||
#
|
||||
# Copyright 2010 - 2015 Johannes Schlatow
|
||||
# Copyright 2010 - 2016 Johannes Schlatow
|
||||
# Copyright 2009 P.C. Shyamshankar
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -26,7 +26,6 @@
|
||||
typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers
|
||||
_task_projects=($(task _projects))
|
||||
_task_tags=($(task _tags))
|
||||
_task_ids=($(task _ids))
|
||||
_task_zshids=( ${(f)"$(task _zshids)"} )
|
||||
_task_config=($(task _config))
|
||||
_task_columns=($(task _columns))
|
||||
@@ -139,8 +138,10 @@ task_dates=(
|
||||
)
|
||||
|
||||
local -a task_zshids
|
||||
_regex_words values 'task IDs' $_task_zshids
|
||||
task_zshids=("$reply[@]")
|
||||
if (( $#_task_zshids )); then
|
||||
_regex_words values 'task IDs' $_task_zshids
|
||||
task_zshids=("$reply[@]")
|
||||
fi
|
||||
|
||||
_regex_words values 'task frequencies' \
|
||||
'daily:Every day' \
|
||||
|
||||
152
src/CLI2.cpp
152
src/CLI2.cpp
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -25,11 +25,12 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <CLI2.h>
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
#include <stdlib.h>
|
||||
#include <Context.h>
|
||||
#include <CLI2.h>
|
||||
#include <Lexer.h>
|
||||
#include <Color.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
@@ -50,11 +51,6 @@ A2::A2 (const std::string& raw, Lexer::Type lextype)
|
||||
attribute ("raw", raw);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
A2::~A2 ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
A2::A2 (const A2& other)
|
||||
: _lextype (other._lextype)
|
||||
@@ -66,23 +62,16 @@ A2::A2 (const A2& other)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
A2& A2::operator= (const A2& other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
_lextype = other._lextype;
|
||||
_tags = other._tags;
|
||||
_attributes = other._attributes;
|
||||
}
|
||||
|
||||
_lextype = other._lextype;
|
||||
_tags = other._tags;
|
||||
_attributes = other._attributes;
|
||||
return *this;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool A2::hasTag (const std::string& tag) const
|
||||
{
|
||||
if (std::find (_tags.begin (), _tags.end (), tag) != _tags.end ())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return std::find (_tags.begin (), _tags.end (), tag) != _tags.end ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -96,13 +85,11 @@ void A2::tag (const std::string& tag)
|
||||
void A2::unTag (const std::string& tag)
|
||||
{
|
||||
for (auto i = _tags.begin (); i != _tags.end (); ++i)
|
||||
{
|
||||
if (*i == tag)
|
||||
{
|
||||
_tags.erase (i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -204,43 +191,29 @@ void A2::decompose ()
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::string A2::dump () const
|
||||
{
|
||||
std::string output = Lexer::typeToString (_lextype);
|
||||
auto output = Lexer::typeToString (_lextype);
|
||||
|
||||
// Dump attributes.
|
||||
std::string atts;
|
||||
for (auto a = _attributes.begin (); a != _attributes.end (); ++a)
|
||||
{
|
||||
if (a != _attributes.begin ())
|
||||
atts += " ";
|
||||
|
||||
atts += a->first + "='\033[33m" + a->second + "\033[0m'";
|
||||
}
|
||||
|
||||
if (atts.length ())
|
||||
output += " " + atts;
|
||||
for (const auto& a : _attributes)
|
||||
atts += a.first + "='\033[33m" + a.second + "\033[0m' ";
|
||||
|
||||
// Dump tags.
|
||||
std::string tags;
|
||||
for (auto& tag : _tags)
|
||||
for (const auto& tag : _tags)
|
||||
{
|
||||
if (tags.length ())
|
||||
tags += ' ';
|
||||
|
||||
if (tag == "BINARY") tags += "\033[1;37;44m" + tag + "\033[0m";
|
||||
else if (tag == "CMD") tags += "\033[1;37;46m" + tag + "\033[0m";
|
||||
else if (tag == "FILTER") tags += "\033[1;37;42m" + tag + "\033[0m";
|
||||
else if (tag == "MODIFICATION") tags += "\033[1;37;43m" + tag + "\033[0m";
|
||||
else if (tag == "MISCELLANEOUS") tags += "\033[1;37;45m" + tag + "\033[0m";
|
||||
else if (tag == "RC") tags += "\033[1;37;41m" + tag + "\033[0m";
|
||||
else if (tag == "CONFIG") tags += "\033[1;37;101m" + tag + "\033[0m";
|
||||
else if (tag == "?") tags += "\033[38;5;255;48;5;232m" + tag + "\033[0m";
|
||||
else tags += "\033[32m" + tag + "\033[0m";
|
||||
if (tag == "BINARY") tags += "\033[1;37;44m" + tag + "\033[0m ";
|
||||
else if (tag == "CMD") tags += "\033[1;37;46m" + tag + "\033[0m ";
|
||||
else if (tag == "FILTER") tags += "\033[1;37;42m" + tag + "\033[0m ";
|
||||
else if (tag == "MODIFICATION") tags += "\033[1;37;43m" + tag + "\033[0m ";
|
||||
else if (tag == "MISCELLANEOUS") tags += "\033[1;37;45m" + tag + "\033[0m ";
|
||||
else if (tag == "RC") tags += "\033[1;37;41m" + tag + "\033[0m ";
|
||||
else if (tag == "CONFIG") tags += "\033[1;37;101m" + tag + "\033[0m ";
|
||||
else if (tag == "?") tags += "\033[38;5;255;48;5;232m" + tag + "\033[0m ";
|
||||
else tags += "\033[32m" + tag + "\033[0m ";
|
||||
}
|
||||
|
||||
if (tags.length ())
|
||||
output += ' ' + tags;
|
||||
|
||||
return output;
|
||||
return output + " " + atts + tags;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -253,7 +226,7 @@ void CLI2::getOverride (int argc, const char** argv, std::string& home, File& rc
|
||||
if (raw == "--")
|
||||
return;
|
||||
|
||||
if (raw.length () > 3 &&
|
||||
if (raw.length () >= 3 &&
|
||||
raw.substr (0, 3) == "rc:")
|
||||
{
|
||||
rc = raw.substr (3);
|
||||
@@ -325,21 +298,10 @@ void CLI2::applyOverrides (int argc, const char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
CLI2::CLI2 ()
|
||||
: _context_filter_added (false)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
CLI2::~CLI2 ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void CLI2::alias (const std::string& name, const std::string& value)
|
||||
{
|
||||
_aliases.insert (std::pair <std::string, std::string> (name, value));
|
||||
_aliases[name] = value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -359,7 +321,7 @@ void CLI2::entity (const std::string& category, const std::string& name)
|
||||
// Capture a single argument.
|
||||
void CLI2::add (const std::string& argument)
|
||||
{
|
||||
A2 arg (trim (argument), Lexer::Type::word);
|
||||
A2 arg (Lexer::trim (argument), Lexer::Type::word);
|
||||
arg.tag ("ORIGINAL");
|
||||
_original_args.push_back (arg);
|
||||
|
||||
@@ -371,10 +333,9 @@ void CLI2::add (const std::string& argument)
|
||||
// Capture a set of arguments, inserted immediately after the binary.
|
||||
void CLI2::add (const std::vector <std::string>& arguments)
|
||||
{
|
||||
std::vector <A2> replacement;
|
||||
replacement.push_back (_original_args[0]);
|
||||
std::vector <A2> replacement {_original_args[0]};
|
||||
|
||||
for (auto& arg : arguments)
|
||||
for (const auto& arg : arguments)
|
||||
replacement.push_back (A2 (arg, Lexer::Type::word));
|
||||
|
||||
for (unsigned int i = 1; i < _original_args.size (); ++i)
|
||||
@@ -397,7 +358,7 @@ void CLI2::handleArg0 ()
|
||||
{
|
||||
// Capture arg0 separately, because it is the command that was run, and could
|
||||
// need special handling.
|
||||
std::string raw = _original_args[0].attribute ("raw");
|
||||
auto raw = _original_args[0].attribute ("raw");
|
||||
A2 a (raw, Lexer::Type::word);
|
||||
a.tag ("BINARY");
|
||||
|
||||
@@ -443,8 +404,7 @@ void CLI2::lexArguments ()
|
||||
Lexer lex (_original_args[i].attribute ("raw"));
|
||||
if (lex.token (lexeme, type) &&
|
||||
(lex.isEOS () || // Token goes to EOS
|
||||
(quoted && type == Lexer::Type::pair)) // Quoted pairs automatically go to EOS
|
||||
)
|
||||
(quoted && type == Lexer::Type::pair))) // Quoted pairs automatically go to EOS
|
||||
{
|
||||
if (! terminated && type == Lexer::Type::separator)
|
||||
terminated = true;
|
||||
@@ -667,7 +627,7 @@ void CLI2::prepareFilter ()
|
||||
if (context.verbose ("filter"))
|
||||
{
|
||||
std::string combined;
|
||||
for (auto& a : _args)
|
||||
for (const auto& a : _args)
|
||||
{
|
||||
if (a.hasTag ("FILTER"))
|
||||
{
|
||||
@@ -688,7 +648,7 @@ void CLI2::prepareFilter ()
|
||||
const std::vector <std::string> CLI2::getWords ()
|
||||
{
|
||||
std::vector <std::string> words;
|
||||
for (auto& a : _args)
|
||||
for (const auto& a : _args)
|
||||
if (a.hasTag ("MISCELLANEOUS"))
|
||||
words.push_back (a.attribute ("raw"));
|
||||
|
||||
@@ -696,7 +656,7 @@ const std::vector <std::string> CLI2::getWords ()
|
||||
{
|
||||
Color colorOrigArgs ("gray10 on gray4");
|
||||
std::string message = " ";
|
||||
for (auto& word : words)
|
||||
for (const auto& word : words)
|
||||
message += colorOrigArgs.colorize (word) + " ";
|
||||
context.debug ("CLI2::getWords" + message);
|
||||
}
|
||||
@@ -749,7 +709,7 @@ std::string CLI2::getBinary () const
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string CLI2::getCommand (bool canonical) const
|
||||
{
|
||||
for (auto& a : _args)
|
||||
for (const auto& a : _args)
|
||||
if (a.hasTag ("CMD"))
|
||||
return a.attribute (canonical ? "canonical" : "raw");
|
||||
|
||||
@@ -776,19 +736,20 @@ const std::string CLI2::dump (const std::string& title) const
|
||||
else
|
||||
out << colorFilter.colorize (i->attribute ("raw"));
|
||||
}
|
||||
|
||||
out << "\n";
|
||||
|
||||
if (_args.size ())
|
||||
{
|
||||
out << " _args\n";
|
||||
for (auto& a : _args)
|
||||
for (const auto& a : _args)
|
||||
out << " " << a.dump () << "\n";
|
||||
}
|
||||
|
||||
if (_id_ranges.size ())
|
||||
{
|
||||
out << " _id_ranges\n ";
|
||||
for (auto& range : _id_ranges)
|
||||
for (const auto& range : _id_ranges)
|
||||
{
|
||||
if (range.first != range.second)
|
||||
out << colorArgs.colorize (range.first + "-" + range.second) << " ";
|
||||
@@ -802,7 +763,7 @@ const std::string CLI2::dump (const std::string& title) const
|
||||
if (_uuid_list.size ())
|
||||
{
|
||||
out << " _uuid_list\n ";
|
||||
for (auto& uuid : _uuid_list)
|
||||
for (const auto& uuid : _uuid_list)
|
||||
out << colorArgs.colorize (uuid) << " ";
|
||||
|
||||
out << "\n";
|
||||
@@ -825,7 +786,7 @@ void CLI2::aliasExpansion ()
|
||||
std::vector <A2> reconstructed;
|
||||
|
||||
std::string raw;
|
||||
for (auto& i : _args)
|
||||
for (const auto& i : _args)
|
||||
{
|
||||
raw = i.attribute ("raw");
|
||||
if (i.hasTag ("TERMINATED"))
|
||||
@@ -853,7 +814,7 @@ void CLI2::aliasExpansion ()
|
||||
|
||||
std::vector <A2> reconstructedOriginals;
|
||||
bool terminated = false;
|
||||
for (auto& i : _original_args)
|
||||
for (const auto& i : _original_args)
|
||||
{
|
||||
if (i.attribute ("raw") == "--")
|
||||
terminated = true;
|
||||
@@ -1186,7 +1147,7 @@ void CLI2::desugarFilterTags ()
|
||||
{
|
||||
bool changes = false;
|
||||
std::vector <A2> reconstructed;
|
||||
for (auto& a : _args)
|
||||
for (const auto& a : _args)
|
||||
{
|
||||
if (a._lextype == Lexer::Type::tag &&
|
||||
a.hasTag ("FILTER"))
|
||||
@@ -1225,7 +1186,7 @@ void CLI2::findStrayModifications ()
|
||||
{
|
||||
bool changes = false;
|
||||
|
||||
std::string command = getCommand ();
|
||||
auto command = getCommand ();
|
||||
if (command == "add" ||
|
||||
command == "log")
|
||||
{
|
||||
@@ -1449,7 +1410,7 @@ void CLI2::desugarFilterPatterns ()
|
||||
{
|
||||
bool changes = false;
|
||||
std::vector <A2> reconstructed;
|
||||
for (auto& a : _args)
|
||||
for (const auto& a : _args)
|
||||
{
|
||||
if (a._lextype == Lexer::Type::pattern &&
|
||||
a.hasTag ("FILTER"))
|
||||
@@ -1500,15 +1461,15 @@ void CLI2::findIDs ()
|
||||
bool previousFilterArgWasAnOperator = false;
|
||||
int filterCount = 0;
|
||||
|
||||
for (auto& a : _args)
|
||||
for (const auto& a : _args)
|
||||
{
|
||||
if (a.hasTag ("FILTER"))
|
||||
{
|
||||
++filterCount;
|
||||
|
||||
if (a._lextype == Lexer::Type::number)
|
||||
{
|
||||
// Skip any number that was preceded by an operator.
|
||||
{
|
||||
// Skip any number that was preceded by an operator.
|
||||
if (! previousFilterArgWasAnOperator)
|
||||
{
|
||||
changes = true;
|
||||
@@ -1527,13 +1488,9 @@ void CLI2::findIDs ()
|
||||
changes = true;
|
||||
auto hyphen = element.find ("-");
|
||||
if (hyphen != std::string::npos)
|
||||
{
|
||||
_id_ranges.push_back (std::pair <std::string, std::string> (element.substr (0, hyphen), element.substr (hyphen + 1)));
|
||||
}
|
||||
else
|
||||
{
|
||||
_id_ranges.push_back (std::pair <std::string, std::string> (element, element));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1582,18 +1539,14 @@ void CLI2::findIDs ()
|
||||
std::vector <std::string> elements;
|
||||
split (elements, raw, ',');
|
||||
|
||||
for (auto& element : elements)
|
||||
for (const auto& element : elements)
|
||||
{
|
||||
changes = true;
|
||||
auto hyphen = element.find ("-");
|
||||
if (hyphen != std::string::npos)
|
||||
{
|
||||
_id_ranges.push_back (std::pair <std::string, std::string> (element.substr (0, hyphen), element.substr (hyphen + 1)));
|
||||
}
|
||||
else
|
||||
{
|
||||
_id_ranges.push_back (std::pair <std::string, std::string> (element, element));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1605,7 +1558,7 @@ void CLI2::findIDs ()
|
||||
else
|
||||
{
|
||||
std::vector <A2> reconstructed;
|
||||
for (auto& a : _args)
|
||||
for (const auto& a : _args)
|
||||
{
|
||||
if (a.hasTag ("FILTER") &&
|
||||
a._lextype == Lexer::Type::number)
|
||||
@@ -1636,7 +1589,7 @@ void CLI2::findUUIDs ()
|
||||
|
||||
if (context.config.getBoolean ("sugar"))
|
||||
{
|
||||
for (auto& a : _args)
|
||||
for (const auto& a : _args)
|
||||
{
|
||||
if (a._lextype == Lexer::Type::uuid &&
|
||||
a.hasTag ("FILTER"))
|
||||
@@ -1666,7 +1619,7 @@ void CLI2::findUUIDs ()
|
||||
else
|
||||
{
|
||||
std::vector <A2> reconstructed;
|
||||
for (auto& a : _args)
|
||||
for (const auto& a : _args)
|
||||
{
|
||||
if (a.hasTag ("FILTER") &&
|
||||
a._lextype == Lexer::Type::uuid)
|
||||
@@ -1704,7 +1657,7 @@ void CLI2::insertIDExpr ()
|
||||
bool changes = false;
|
||||
bool foundID = false;
|
||||
std::vector <A2> reconstructed;
|
||||
for (auto& a : _args)
|
||||
for (const auto& a : _args)
|
||||
{
|
||||
if ((a._lextype == Lexer::Type::set ||
|
||||
a._lextype == Lexer::Type::number ||
|
||||
@@ -1845,7 +1798,7 @@ void CLI2::lexFilterArgs ()
|
||||
{
|
||||
bool changes = false;
|
||||
std::vector <A2> reconstructed;
|
||||
for (auto& a : _args)
|
||||
for (const auto& a : _args)
|
||||
{
|
||||
if (a._lextype == Lexer::Type::word &&
|
||||
a.hasTag ("FILTER"))
|
||||
@@ -1942,11 +1895,10 @@ void CLI2::desugarFilterPlainArgs ()
|
||||
last.tag ("PLAIN");
|
||||
}
|
||||
|
||||
|
||||
// Walk the list again, upgrading PLAIN args.
|
||||
bool changes = false;
|
||||
std::vector <A2> reconstructed;
|
||||
for (auto& a : _args)
|
||||
for (const auto& a : _args)
|
||||
{
|
||||
if (a.hasTag ("PLAIN"))
|
||||
{
|
||||
@@ -2054,7 +2006,7 @@ void CLI2::defaultCommand ()
|
||||
bool found_command = false;
|
||||
bool found_sequence = false;
|
||||
|
||||
for (auto& a : _args)
|
||||
for (const auto& a : _args)
|
||||
{
|
||||
std::string raw = a.attribute ("raw");
|
||||
|
||||
|
||||
26
src/CLI2.h
26
src/CLI2.h
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -37,7 +37,6 @@ class A2
|
||||
{
|
||||
public:
|
||||
A2 (const std::string&, Lexer::Type);
|
||||
~A2 ();
|
||||
A2 (const A2&);
|
||||
A2& operator= (const A2&);
|
||||
bool hasTag (const std::string&) const;
|
||||
@@ -50,9 +49,9 @@ public:
|
||||
void decompose ();
|
||||
|
||||
public:
|
||||
Lexer::Type _lextype;
|
||||
std::vector <std::string> _tags;
|
||||
std::map <std::string, std::string> _attributes;
|
||||
Lexer::Type _lextype {Lexer::Type::word};
|
||||
std::vector <std::string> _tags {};
|
||||
std::map <std::string, std::string> _attributes {};
|
||||
};
|
||||
|
||||
// Represents the command line.
|
||||
@@ -66,8 +65,7 @@ public:
|
||||
static void applyOverrides (int, const char**);
|
||||
|
||||
public:
|
||||
CLI2 ();
|
||||
~CLI2 ();
|
||||
CLI2 () = default;
|
||||
void alias (const std::string&, const std::string&);
|
||||
void entity (const std::string&, const std::string&);
|
||||
|
||||
@@ -107,14 +105,14 @@ private:
|
||||
std::vector <A2> lexExpression (const std::string&);
|
||||
|
||||
public:
|
||||
std::multimap <std::string, std::string> _entities;
|
||||
std::map <std::string, std::string> _aliases;
|
||||
std::vector <A2> _original_args;
|
||||
std::vector <A2> _args;
|
||||
std::multimap <std::string, std::string> _entities {};
|
||||
std::map <std::string, std::string> _aliases {};
|
||||
std::vector <A2> _original_args {};
|
||||
std::vector <A2> _args {};
|
||||
|
||||
std::vector <std::pair <std::string, std::string>> _id_ranges;
|
||||
std::vector <std::string> _uuid_list;
|
||||
bool _context_filter_added;
|
||||
std::vector <std::pair <std::string, std::string>> _id_ranges {};
|
||||
std::vector <std::string> _uuid_list {};
|
||||
bool _context_filter_added {false};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
172
src/Color.cpp
172
src/Color.cpp
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -25,15 +25,47 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <Color.h>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <main.h>
|
||||
#include <Color.h>
|
||||
#include <Lexer.h>
|
||||
#include <text.h>
|
||||
#include <i18n.h>
|
||||
#include <string>
|
||||
|
||||
// uint to string lookup table for Color::_colorize()
|
||||
// _colorize() gets called _a lot_, having this lookup table is a cheap
|
||||
// performance optimization.
|
||||
const char *colorstring[] = {
|
||||
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
|
||||
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
|
||||
"20", "21", "22", "23", "24", "25", "26", "27", "28", "29",
|
||||
"30", "31", "32", "33", "34", "35", "36", "37", "38", "39",
|
||||
"40", "41", "42", "43", "44", "45", "46", "47", "48", "49",
|
||||
"50", "51", "52", "53", "54", "55", "56", "57", "58", "59",
|
||||
"60", "61", "62", "63", "64", "65", "66", "67", "68", "69",
|
||||
"70", "71", "72", "73", "74", "75", "76", "77", "78", "79",
|
||||
"80", "81", "82", "83", "84", "85", "86", "87", "88", "89",
|
||||
"90", "91", "92", "93", "94", "95", "96", "97", "98", "99",
|
||||
"100", "101", "102", "103", "104", "105", "106", "107", "108", "109",
|
||||
"110", "111", "112", "113", "114", "115", "116", "117", "118", "119",
|
||||
"120", "121", "122", "123", "124", "125", "126", "127", "128", "129",
|
||||
"130", "131", "132", "133", "134", "135", "136", "137", "138", "139",
|
||||
"140", "141", "142", "143", "144", "145", "146", "147", "148", "149",
|
||||
"150", "151", "152", "153", "154", "155", "156", "157", "158", "159",
|
||||
"160", "161", "162", "163", "164", "165", "166", "167", "168", "169",
|
||||
"170", "171", "172", "173", "174", "175", "176", "177", "178", "179",
|
||||
"180", "181", "182", "183", "184", "185", "186", "187", "188", "189",
|
||||
"190", "191", "192", "193", "194", "195", "196", "197", "198", "199",
|
||||
"200", "201", "202", "203", "204", "205", "206", "207", "208", "209",
|
||||
"210", "211", "212", "213", "214", "215", "216", "217", "218", "219",
|
||||
"220", "221", "222", "223", "224", "225", "226", "227", "228", "229",
|
||||
"230", "231", "232", "233", "234", "235", "236", "237", "238", "239",
|
||||
"240", "241", "242", "243", "244", "245", "246", "247", "248", "249",
|
||||
"250", "251", "252", "253", "254", "255"
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static struct
|
||||
@@ -109,10 +141,9 @@ Color::Color (const std::string& spec)
|
||||
|
||||
bool bg = false;
|
||||
int index;
|
||||
std::string word;
|
||||
for (auto& it : words)
|
||||
for (auto& word : words)
|
||||
{
|
||||
word = lowerCase (trim (it));
|
||||
word = Lexer::lowerCase (Lexer::trim (word));
|
||||
|
||||
if (word == "bold") fg_value |= _COLOR_BOLD;
|
||||
else if (word == "bright") bg_value |= _COLOR_BRIGHT;
|
||||
@@ -139,12 +170,12 @@ Color::Color (const std::string& spec)
|
||||
}
|
||||
|
||||
// greyN/grayN, where 0 <= N <= 23.
|
||||
else if (word.substr (0, 4) == "grey" ||
|
||||
word.substr (0, 4) == "gray")
|
||||
else if (! word.compare (0, 4, "grey", 4) ||
|
||||
! word.compare (0, 4, "gray", 4))
|
||||
{
|
||||
index = atoi (word.substr (4).c_str ());
|
||||
index = strtol (word.substr (4).c_str (), nullptr, 10);
|
||||
if (index < 0 || index > 23)
|
||||
throw format (STRING_COLOR_UNRECOGNIZED, it);
|
||||
throw format (STRING_COLOR_UNRECOGNIZED, word);
|
||||
|
||||
if (bg)
|
||||
{
|
||||
@@ -161,20 +192,20 @@ Color::Color (const std::string& spec)
|
||||
}
|
||||
|
||||
// rgbRGB, where 0 <= R,G,B <= 5.
|
||||
else if (word.substr (0, 3) == "rgb")
|
||||
else if (! word.compare (0, 3, "rgb", 3))
|
||||
{
|
||||
index = atoi (word.substr (3).c_str ());
|
||||
index = strtol (word.substr (3).c_str (), nullptr, 10);
|
||||
if (word.length () != 6 ||
|
||||
index < 0 || index > 555)
|
||||
throw format (STRING_COLOR_UNRECOGNIZED, it);
|
||||
throw format (STRING_COLOR_UNRECOGNIZED, word);
|
||||
|
||||
int r = atoi (word.substr (3, 1).c_str ());
|
||||
int g = atoi (word.substr (4, 1).c_str ());
|
||||
int b = atoi (word.substr (5, 1).c_str ());
|
||||
int r = strtol (word.substr (3, 1).c_str (), nullptr, 10);
|
||||
int g = strtol (word.substr (4, 1).c_str (), nullptr, 10);
|
||||
int b = strtol (word.substr (5, 1).c_str (), nullptr, 10);
|
||||
if (r < 0 || r > 5 ||
|
||||
g < 0 || g > 5 ||
|
||||
b < 0 || b > 5)
|
||||
throw format (STRING_COLOR_UNRECOGNIZED, it);
|
||||
throw format (STRING_COLOR_UNRECOGNIZED, word);
|
||||
|
||||
index = 16 + r*36 + g*6 + b;
|
||||
|
||||
@@ -193,11 +224,11 @@ Color::Color (const std::string& spec)
|
||||
}
|
||||
|
||||
// colorN, where 0 <= N <= 255.
|
||||
else if (word.substr (0, 5) == "color")
|
||||
else if (! word.compare (0, 5, "color", 5))
|
||||
{
|
||||
index = atoi (word.substr (5).c_str ());
|
||||
index = strtol (word.substr (5).c_str (), nullptr, 10);
|
||||
if (index < 0 || index > 255)
|
||||
throw format (STRING_COLOR_UNRECOGNIZED, it);
|
||||
throw format (STRING_COLOR_UNRECOGNIZED, word);
|
||||
|
||||
upgrade ();
|
||||
|
||||
@@ -215,7 +246,7 @@ Color::Color (const std::string& spec)
|
||||
}
|
||||
}
|
||||
else if (word != "")
|
||||
throw format (STRING_COLOR_UNRECOGNIZED, it);
|
||||
throw format (STRING_COLOR_UNRECOGNIZED, word);
|
||||
}
|
||||
|
||||
// Now combine the fg and bg into a single color.
|
||||
@@ -234,23 +265,6 @@ Color::Color (color_id fg)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Color::Color (color_id fg, color_id bg)
|
||||
: _value (0)
|
||||
{
|
||||
if (bg != Color::nocolor)
|
||||
{
|
||||
_value |= _COLOR_HASBG;
|
||||
_value |= (bg << 8);
|
||||
}
|
||||
|
||||
if (fg != Color::nocolor)
|
||||
{
|
||||
_value |= _COLOR_HASFG;
|
||||
_value |= fg;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Color::Color (color_id fg, color_id bg, bool underline, bool bold, bool bright)
|
||||
: _value (0)
|
||||
@@ -272,20 +286,6 @@ Color::Color (color_id fg, color_id bg, bool underline, bool bold, bool bright)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Color::~Color ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Color& Color::operator= (const Color& other)
|
||||
{
|
||||
if (this != &other)
|
||||
_value = other._value;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Color::operator std::string () const
|
||||
{
|
||||
@@ -405,6 +405,14 @@ void Color::upgrade ()
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string Color::colorize (const std::string& input) const
|
||||
{
|
||||
std::string result;
|
||||
_colorize (result, input);
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Sample color codes:
|
||||
// red \033[31m
|
||||
@@ -417,74 +425,82 @@ void Color::upgrade ()
|
||||
//
|
||||
// 256 fg \033[38;5;Nm
|
||||
// 256 bg \033[48;5;Nm
|
||||
std::string Color::colorize (const std::string& input)
|
||||
void Color::_colorize (std::string &result, const std::string& input) const
|
||||
{
|
||||
if (!nontrivial ())
|
||||
return input;
|
||||
{
|
||||
result += input;
|
||||
return;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
std::stringstream result;
|
||||
|
||||
// 256 color
|
||||
if (_value & _COLOR_256)
|
||||
{
|
||||
if (_value & _COLOR_UNDERLINE)
|
||||
result << "\033[4m";
|
||||
result += "\033[4m";
|
||||
|
||||
if (_value & _COLOR_INVERSE)
|
||||
result << "\033[7m";
|
||||
result += "\033[7m";
|
||||
|
||||
if (_value & _COLOR_HASFG)
|
||||
result << "\033[38;5;" << (_value & _COLOR_FG) << "m";
|
||||
{
|
||||
result += "\033[38;5;";
|
||||
result += colorstring[(_value & _COLOR_FG)];
|
||||
result += "m";
|
||||
}
|
||||
|
||||
if (_value & _COLOR_HASBG)
|
||||
result << "\033[48;5;" << ((_value & _COLOR_BG) >> 8) << "m";
|
||||
{
|
||||
result += "\033[48;5;";
|
||||
result += colorstring[((_value & _COLOR_BG) >> 8)];
|
||||
result += "m";
|
||||
}
|
||||
|
||||
result << input << "\033[0m";
|
||||
|
||||
return result.str ();
|
||||
result += input;
|
||||
result += "\033[0m";
|
||||
}
|
||||
|
||||
// 16 color
|
||||
else
|
||||
{
|
||||
result << "\033[";
|
||||
result += "\033[";
|
||||
|
||||
if (_value & _COLOR_BOLD)
|
||||
{
|
||||
if (count++) result << ";";
|
||||
result << "1";
|
||||
if (count++) result += ";";
|
||||
result += "1";
|
||||
}
|
||||
|
||||
if (_value & _COLOR_UNDERLINE)
|
||||
{
|
||||
if (count++) result << ";";
|
||||
result << "4";
|
||||
if (count++) result += ";";
|
||||
result += "4";
|
||||
}
|
||||
|
||||
if (_value & _COLOR_INVERSE)
|
||||
{
|
||||
if (count++) result << ";";
|
||||
result << "7";
|
||||
if (count++) result += ";";
|
||||
result += "7";
|
||||
}
|
||||
|
||||
if (_value & _COLOR_HASFG)
|
||||
{
|
||||
if (count++) result << ";";
|
||||
result << (29 + (_value & _COLOR_FG));
|
||||
if (count++) result += ";";
|
||||
result += colorstring[(29 + (_value & _COLOR_FG))];
|
||||
}
|
||||
|
||||
if (_value & _COLOR_HASBG)
|
||||
{
|
||||
if (count++) result << ";";
|
||||
result << ((_value & _COLOR_BRIGHT ? 99 : 39) + ((_value & _COLOR_BG) >> 8));
|
||||
if (count++) result += ";";
|
||||
result += colorstring[((_value & _COLOR_BRIGHT ? 99 : 39) + ((_value & _COLOR_BG) >> 8))];
|
||||
}
|
||||
|
||||
result << "m" << input << "\033[0m";
|
||||
return result.str ();
|
||||
result += "m";
|
||||
result += input;
|
||||
result += "\033[0m";
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
11
src/Color.h
11
src/Color.h
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#define _COLOR_INVERSE 0x00400000 // Inverse attribute.
|
||||
#define _COLOR_256 0x00200000 // 256-color mode.
|
||||
#define _COLOR_HASBG 0x00100000 // Has background color (all values taken).
|
||||
@@ -50,18 +49,16 @@ public:
|
||||
Color (unsigned int); // 256 | INVERSE | UNDERLINE | BOLD | BRIGHT | (BG << 8) | FG
|
||||
Color (const std::string&); // "red on bright black"
|
||||
Color (color_id); // fg.
|
||||
Color (color_id, color_id); // fg, bg.
|
||||
Color (color_id, color_id, bool, bool, bool); // fg, bg, underline, bold, bright
|
||||
~Color ();
|
||||
Color& operator= (const Color&);
|
||||
operator std::string () const;
|
||||
operator int () const;
|
||||
|
||||
void upgrade ();
|
||||
void blend (const Color&);
|
||||
|
||||
std::string colorize (const std::string&);
|
||||
std::string colorize (const std::string&) const;
|
||||
static std::string colorize (const std::string&, const std::string&);
|
||||
void _colorize (std::string&, const std::string&) const;
|
||||
static std::string strip (const std::string&);
|
||||
|
||||
bool nontrivial () const;
|
||||
@@ -76,5 +73,3 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
134
src/Config.cpp
134
src/Config.cpp
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -25,6 +25,7 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <Config.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
@@ -37,7 +38,7 @@
|
||||
#include <FS.h>
|
||||
#include <Timer.h>
|
||||
#include <JSON.h>
|
||||
#include <Config.h>
|
||||
#include <Lexer.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
@@ -94,13 +95,11 @@ std::string Config::_defaults =
|
||||
"recurrence.indicator=R # What to show as a task recurrence indicator\n"
|
||||
"recurrence.limit=1 # Number of future recurring pending tasks\n"
|
||||
"undo.style=side # Undo style - can be 'side', or 'diff'\n"
|
||||
"burndown.bias=0.666 # Weighted mean bias toward recent data\n"
|
||||
"regex=yes # Assume all search/filter strings are regexes\n"
|
||||
"xterm.title=no # Sets xterm title for some commands\n"
|
||||
"expressions=infix # Prefer infix over postfix expressions\n"
|
||||
"dom=on # Support DOM access\n"
|
||||
"json.array=on # Enclose JSON output in [ ]\n"
|
||||
"json.depends.array=on # Encode dependencies as a JSON array\n"
|
||||
"json.depends.array=off # Encode dependencies as a JSON array\n"
|
||||
"abbreviation.minimum=2 # Shortest allowed abbreviation\n"
|
||||
"\n"
|
||||
"# Dates\n"
|
||||
@@ -157,7 +156,6 @@ std::string Config::_defaults =
|
||||
"\n"
|
||||
"# Color controls.\n"
|
||||
"color=on # Enable color\n"
|
||||
#if defined(LINUX) || defined(DARWIN)
|
||||
"\n"
|
||||
"rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.\n"
|
||||
"\n"
|
||||
@@ -232,85 +230,6 @@ std::string Config::_defaults =
|
||||
"color.undo.after=color2\n"
|
||||
"color.undo.before=color1\n"
|
||||
"\n"
|
||||
#else
|
||||
"\n"
|
||||
"rule.precedence.color=deleted,completed,active,keyword.,tag.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,uda.\n"
|
||||
"\n"
|
||||
"# General decoration\n"
|
||||
"rule.color.merge=yes\n"
|
||||
"color.label=\n"
|
||||
"color.label.sort=\n"
|
||||
"color.alternate=\n"
|
||||
"color.header=yellow\n"
|
||||
"color.footnote=yellow\n"
|
||||
"color.warning=bold red\n"
|
||||
"color.error=white on red\n"
|
||||
"color.debug=blue\n"
|
||||
"\n"
|
||||
"# Task state\n"
|
||||
"color.completed=\n"
|
||||
"color.deleted=\n"
|
||||
"color.active=black on bright green\n"
|
||||
"color.recurring=magenta\n"
|
||||
"color.scheduled=white on green\n"
|
||||
"color.until=\n"
|
||||
"color.blocked=black on white\n"
|
||||
"color.blocking=black on bright white\n"
|
||||
"\n"
|
||||
"# Project\n"
|
||||
"color.project.none=\n"
|
||||
"\n"
|
||||
"# Priority UDA\n"
|
||||
"color.uda.priority.H=bold white\n"
|
||||
"color.uda.priority.M=white\n"
|
||||
"color.uda.priority.L=\n"
|
||||
"\n"
|
||||
"# Tags\n"
|
||||
"color.tag.next=bold yellow\n"
|
||||
"color.tag.none=\n"
|
||||
"color.tagged=green\n"
|
||||
"\n"
|
||||
"# Due\n"
|
||||
"color.due=red\n"
|
||||
"color.due.today=red\n"
|
||||
"color.overdue=bold red\n"
|
||||
"\n"
|
||||
"# UDA\n"
|
||||
"#color.uda.X=\n"
|
||||
"\n"
|
||||
"# Report: burndown\n"
|
||||
"color.burndown.done=on green\n"
|
||||
"color.burndown.pending=on red\n"
|
||||
"color.burndown.started=on yellow\n"
|
||||
"\n"
|
||||
"# Report: history\n"
|
||||
"color.history.add=black on red\n"
|
||||
"color.history.delete=black on yellow\n"
|
||||
"color.history.done=black on green\n"
|
||||
"\n"
|
||||
"# Report: summary\n"
|
||||
"color.summary.background=white on black\n"
|
||||
"color.summary.bar=black on green\n"
|
||||
"\n"
|
||||
"# Command: calendar\n"
|
||||
"color.calendar.due=white on red\n"
|
||||
"color.calendar.due.today=bold white on red\n"
|
||||
"color.calendar.holiday=black on bright yellow\n"
|
||||
"color.calendar.overdue=black on bright red\n"
|
||||
"color.calendar.today=bold white on bright blue\n"
|
||||
"color.calendar.weekend=white on bright black\n"
|
||||
"color.calendar.weeknumber=bold blue\n"
|
||||
"\n"
|
||||
"# Command: sync\n"
|
||||
"color.sync.added=green\n"
|
||||
"color.sync.changed=yellow\n"
|
||||
"color.sync.rejected=red\n"
|
||||
"\n"
|
||||
"# Command: undo\n"
|
||||
"color.undo.after=green\n"
|
||||
"color.undo.before=red\n"
|
||||
"\n"
|
||||
#endif
|
||||
"# UDA priority\n"
|
||||
"uda.priority.type=string # UDA priority is a string type\n"
|
||||
"uda.priority.label=Priority # UDA priority has a display label'\n"
|
||||
@@ -340,7 +259,6 @@ std::string Config::_defaults =
|
||||
"sugar=yes # Syntactic sugar\n"
|
||||
"obfuscate=no # Obfuscate data for error reporting\n"
|
||||
"fontunderline=yes # Uses underlines rather than -------\n"
|
||||
"shell.prompt=task> # Prompt used by the shell command\n"
|
||||
"\n"
|
||||
"# WARNING: Please read the documentation (man task-sync) before setting up\n"
|
||||
"# Taskwarrior for Taskserver synchronization.\n"
|
||||
@@ -435,7 +353,7 @@ std::string Config::_defaults =
|
||||
"\n"
|
||||
"report.next.description=Most urgent tasks\n"
|
||||
"report.next.labels=ID,Active,Age,Deps,P,Project,Tag,Recur,S,Due,Until,Description,Urg\n"
|
||||
"report.next.columns=id,start.age,entry.age,depends,priority,project,tags,recur,scheduled.countdown,due.remaining,until.remaining,description,urgency\n"
|
||||
"report.next.columns=id,start.age,entry.age,depends,priority,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency\n"
|
||||
"report.next.filter=status:pending limit:page\n"
|
||||
"report.next.sort=urgency-\n"
|
||||
"\n"
|
||||
@@ -459,7 +377,7 @@ std::string Config::_defaults =
|
||||
"\n"
|
||||
"report.blocking.description=Blocking tasks\n"
|
||||
"report.blocking.labels=ID,UUID,A,Deps,Project,Tags,R,W,Sch,Due,Until,Description,Urg\n"
|
||||
"report.blocking.columns=id,uuid.short,start.active,depends,project,tags,recur,wait,scheduled.remaining,due.remaining,until.remaining,description.count,urgency\n"
|
||||
"report.blocking.columns=id,uuid.short,start.active,depends,project,tags,recur,wait,scheduled.remaining,due.relative,until.remaining,description.count,urgency\n"
|
||||
"report.blocking.sort=urgency-,due+,entry+\n"
|
||||
"report.blocking.filter= status:pending +BLOCKING\n"
|
||||
"\n";
|
||||
@@ -477,13 +395,6 @@ Config::Config ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Config::Config (const std::string& file)
|
||||
{
|
||||
setDefaults ();
|
||||
load (file);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Read the Configuration file and populate the *this map. The file format is
|
||||
// simply lines with name=value pairs. Whitespace between name, = and value is
|
||||
@@ -531,7 +442,7 @@ void Config::parse (const std::string& input, int nest /* = 1 */)
|
||||
if (pound != std::string::npos)
|
||||
line = line.substr (0, pound);
|
||||
|
||||
line = trim (line, " \t"); // no i18n
|
||||
line = Lexer::trim (line, " \t"); // no i18n
|
||||
|
||||
// Skip empty lines.
|
||||
if (line.length () > 0)
|
||||
@@ -539,8 +450,8 @@ void Config::parse (const std::string& input, int nest /* = 1 */)
|
||||
auto equal = line.find ("="); // no i18n
|
||||
if (equal != std::string::npos)
|
||||
{
|
||||
std::string key = trim (line.substr (0, equal), " \t"); // no i18n
|
||||
std::string value = trim (line.substr (equal+1, line.length () - equal), " \t"); // no i18n
|
||||
std::string key = Lexer::trim (line.substr (0, equal), " \t"); // no i18n
|
||||
std::string value = Lexer::trim (line.substr (equal+1, line.length () - equal), " \t"); // no i18n
|
||||
|
||||
(*this)[key] = json::decode (value);
|
||||
}
|
||||
@@ -549,7 +460,7 @@ void Config::parse (const std::string& input, int nest /* = 1 */)
|
||||
auto include = line.find ("include"); // no i18n.
|
||||
if (include != std::string::npos)
|
||||
{
|
||||
Path included (trim (line.substr (include + 7), " \t"));
|
||||
Path included (Lexer::trim (line.substr (include + 7), " \t"));
|
||||
if (included.is_absolute ())
|
||||
{
|
||||
if (included.readable ())
|
||||
@@ -643,14 +554,19 @@ bool Config::has (const std::string& key)
|
||||
// Return the configuration value given the specified key.
|
||||
std::string Config::get (const std::string& key)
|
||||
{
|
||||
return (*this)[key];
|
||||
auto found = find (key);
|
||||
if (found != end ())
|
||||
return found->second;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int Config::getInteger (const std::string& key)
|
||||
{
|
||||
if ((*this).find (key) != (*this).end ())
|
||||
return strtoimax ((*this)[key].c_str (), NULL, 10);
|
||||
auto found = find (key);
|
||||
if (found != end ())
|
||||
return strtoimax (found->second.c_str (), nullptr, 10);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -660,11 +576,12 @@ double Config::getReal (const std::string& key)
|
||||
{
|
||||
//NOTE: Backwards compatible handling of next coefficient.
|
||||
//TODO: Remove.
|
||||
if (key == "urgency.user.tag.next.coefficient" and has("urgency.next.coefficient"))
|
||||
return getReal("urgency.next.coefficient");
|
||||
if (key == "urgency.user.tag.next.coefficient" and has ("urgency.next.coefficient"))
|
||||
return getReal ("urgency.next.coefficient");
|
||||
|
||||
if ((*this).find (key) != (*this).end ())
|
||||
return strtod ((*this)[key].c_str (), NULL);
|
||||
auto found = find (key);
|
||||
if (found != end ())
|
||||
return strtod (found->second.c_str (), nullptr);
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
@@ -672,9 +589,10 @@ double Config::getReal (const std::string& key)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Config::getBoolean (const std::string& key)
|
||||
{
|
||||
if ((*this).find (key) != (*this).end ())
|
||||
auto found = find (key);
|
||||
if (found != end ())
|
||||
{
|
||||
std::string value = lowerCase ((*this)[key]);
|
||||
std::string value = Lexer::lowerCase ((*this)[key]);
|
||||
if (value == "t" || // TODO Deprecate
|
||||
value == "true" ||
|
||||
value == "1" ||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -36,8 +36,6 @@ class Config : public std::map <std::string, std::string>
|
||||
{
|
||||
public:
|
||||
Config ();
|
||||
Config (const std::string&);
|
||||
|
||||
Config (const Config&);
|
||||
Config& operator= (const Config&);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -25,6 +25,7 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <Context.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
@@ -33,7 +34,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <Context.h>
|
||||
#include <FS.h>
|
||||
#include <Eval.h>
|
||||
#include <Variant.h>
|
||||
@@ -71,7 +71,6 @@ Context::Context ()
|
||||
, data_dir ("~/.task")
|
||||
, config ()
|
||||
, tdb2 ()
|
||||
, dom ()
|
||||
, determine_color_use (true)
|
||||
, use_color (true)
|
||||
, run_gc (true)
|
||||
@@ -339,15 +338,15 @@ int Context::run ()
|
||||
<< " sort:" << timer_sort.total ()
|
||||
<< " render:" << timer_render.total ()
|
||||
<< " hooks:" << timer_hooks.total ()
|
||||
<< " other:" << timer_total.total () -
|
||||
(timer_init.total () +
|
||||
timer_load.total () +
|
||||
timer_gc.total () +
|
||||
timer_filter.total () +
|
||||
timer_commit.total () +
|
||||
timer_sort.total () +
|
||||
timer_render.total () +
|
||||
timer_hooks.total ())
|
||||
<< " other:" << timer_total.total () -
|
||||
timer_init.total () -
|
||||
timer_load.total () -
|
||||
timer_gc.total () -
|
||||
timer_filter.total () -
|
||||
timer_commit.total () -
|
||||
timer_sort.total () -
|
||||
timer_render.total () -
|
||||
timer_hooks.total ()
|
||||
<< " total:" << timer_total.total ()
|
||||
<< "\n";
|
||||
debug (s.str ());
|
||||
@@ -683,7 +682,7 @@ void Context::staticInitialization ()
|
||||
void Context::createDefaultConfig ()
|
||||
{
|
||||
// Do we need to create a default rc?
|
||||
if (! rc_file.exists ())
|
||||
if (rc_file._data != "" && ! rc_file.exists ())
|
||||
{
|
||||
if (config.getBoolean ("confirmation") &&
|
||||
!confirm (format (STRING_CONTEXT_CREATE_RC, home_dir, rc_file._data)))
|
||||
@@ -832,12 +831,3 @@ void Context::debug (const std::string& input)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Context::clearMessages ()
|
||||
{
|
||||
headers.clear ();
|
||||
footnotes.clear ();
|
||||
errors.clear ();
|
||||
debugMessages.clear ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <Task.h>
|
||||
#include <TDB2.h>
|
||||
#include <Hooks.h>
|
||||
#include <DOM.h>
|
||||
#include <FS.h>
|
||||
#include <CLI2.h>
|
||||
#include <Timer.h>
|
||||
@@ -65,7 +64,6 @@ public:
|
||||
void footnote (const std::string&); // Footnote message sink
|
||||
void debug (const std::string&); // Debug message sink
|
||||
void error (const std::string&); // Error message sink - non-maskable
|
||||
void clearMessages ();
|
||||
|
||||
void decomposeSortField (const std::string&, std::string&, bool&, bool&);
|
||||
|
||||
@@ -86,7 +84,6 @@ public:
|
||||
|
||||
TDB2 tdb2;
|
||||
Hooks hooks;
|
||||
DOM dom;
|
||||
|
||||
bool determine_color_use;
|
||||
bool use_color;
|
||||
|
||||
48
src/DOM.cpp
48
src/DOM.cpp
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -25,6 +25,7 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <DOM.h>
|
||||
#include <sstream>
|
||||
#include <map>
|
||||
#include <stdlib.h>
|
||||
@@ -34,20 +35,9 @@
|
||||
#include <ISO8601.h>
|
||||
#include <text.h>
|
||||
#include <i18n.h>
|
||||
#include <DOM.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
DOM::DOM ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
DOM::~DOM ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// DOM Supported References:
|
||||
//
|
||||
@@ -62,7 +52,7 @@ DOM::~DOM ()
|
||||
// system.version
|
||||
// system.os
|
||||
//
|
||||
bool DOM::get (const std::string& name, Variant& value)
|
||||
bool getDOM (const std::string& name, Variant& value)
|
||||
{
|
||||
// Special case, blank refs cause problems.
|
||||
if (name == "")
|
||||
@@ -73,7 +63,7 @@ bool DOM::get (const std::string& name, Variant& value)
|
||||
|
||||
// rc. --> context.config
|
||||
if (len > 3 &&
|
||||
name.substr (0, 3) == "rc.")
|
||||
! name.compare (0, 3, "rc.", 3))
|
||||
{
|
||||
std::string key = name.substr (3);
|
||||
auto c = context.config.find (key);
|
||||
@@ -88,7 +78,7 @@ bool DOM::get (const std::string& name, Variant& value)
|
||||
|
||||
// context.*
|
||||
if (len > 8 &&
|
||||
name.substr (0, 8) == "context.")
|
||||
! name.compare (0, 8, "context.", 8))
|
||||
{
|
||||
if (name == "context.program")
|
||||
{
|
||||
@@ -131,7 +121,7 @@ bool DOM::get (const std::string& name, Variant& value)
|
||||
|
||||
// system. --> Implement locally.
|
||||
if (len > 7 &&
|
||||
name.substr (0, 7) == "system.")
|
||||
! name.compare (0, 7, "system.", 7))
|
||||
{
|
||||
// Taskwarrior version number.
|
||||
if (name == "system.version")
|
||||
@@ -204,20 +194,20 @@ bool DOM::get (const std::string& name, Variant& value)
|
||||
//
|
||||
// This code emphasizes speed, hence 'id' and 'urgecny' being evaluated first
|
||||
// as special cases.
|
||||
bool DOM::get (const std::string& name, const Task& task, Variant& value)
|
||||
bool getDOM (const std::string& name, const Task& task, Variant& value)
|
||||
{
|
||||
// Special case, blank refs cause problems.
|
||||
if (name == "")
|
||||
return false;
|
||||
|
||||
// Quickly deal with the most common cases.
|
||||
if (task.size () && name == "id")
|
||||
if (task.data.size () && name == "id")
|
||||
{
|
||||
value = Variant (static_cast<int> (task.id));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (task.size () && name == "urgency")
|
||||
if (task.data.size () && name == "urgency")
|
||||
{
|
||||
value = Variant (task.urgency_c ());
|
||||
return true;
|
||||
@@ -262,13 +252,13 @@ bool DOM::get (const std::string& name, const Task& task, Variant& value)
|
||||
{
|
||||
// Now that 'ref' is the contextual task, and any ID/UUID is chopped off the
|
||||
// elements vector, DOM resolution is now simple.
|
||||
if (ref.size () && size == 1 && canonical == "id")
|
||||
if (ref.data.size () && size == 1 && canonical == "id")
|
||||
{
|
||||
value = Variant (static_cast<int> (ref.id));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ref.size () && size == 1 && canonical == "urgency")
|
||||
if (ref.data.size () && size == 1 && canonical == "urgency")
|
||||
{
|
||||
value = Variant (ref.urgency_c ());
|
||||
return true;
|
||||
@@ -276,7 +266,7 @@ bool DOM::get (const std::string& name, const Task& task, Variant& value)
|
||||
|
||||
Column* column = context.columns[canonical];
|
||||
|
||||
if (ref.size () && size == 1 && column)
|
||||
if (ref.data.size () && size == 1 && column)
|
||||
{
|
||||
if (column->is_uda () && ! ref.has (canonical))
|
||||
{
|
||||
@@ -311,13 +301,13 @@ bool DOM::get (const std::string& name, const Task& task, Variant& value)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ref.size () && size == 2 && canonical == "tags")
|
||||
if (ref.data.size () && size == 2 && canonical == "tags")
|
||||
{
|
||||
value = Variant (ref.hasTag (elements[1]) ? elements[1] : "");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ref.size () && size == 2 && column && column->type () == "date")
|
||||
if (ref.data.size () && size == 2 && column && column->type () == "date")
|
||||
{
|
||||
ISO8601d date (ref.get_date (canonical));
|
||||
if (elements[1] == "year") { value = Variant (static_cast<int> (date.year ())); return true; }
|
||||
@@ -332,7 +322,7 @@ bool DOM::get (const std::string& name, const Task& task, Variant& value)
|
||||
}
|
||||
}
|
||||
|
||||
if (ref.size () && size == 3 && elements[0] == "annotations")
|
||||
if (ref.data.size () && size == 3 && elements[0] == "annotations")
|
||||
{
|
||||
std::map <std::string, std::string> annos;
|
||||
ref.getAnnotations (annos);
|
||||
@@ -341,7 +331,7 @@ bool DOM::get (const std::string& name, const Task& task, Variant& value)
|
||||
int count = 0;
|
||||
|
||||
// Count off the 'a'th annotation.
|
||||
for (auto& i : annos)
|
||||
for (const auto& i : annos)
|
||||
{
|
||||
if (++count == a)
|
||||
{
|
||||
@@ -361,7 +351,7 @@ bool DOM::get (const std::string& name, const Task& task, Variant& value)
|
||||
}
|
||||
}
|
||||
|
||||
if (ref.size () && size == 4 && elements[0] == "annotations" && elements[2] == "entry")
|
||||
if (ref.data.size () && size == 4 && elements[0] == "annotations" && elements[2] == "entry")
|
||||
{
|
||||
std::map <std::string, std::string> annos;
|
||||
ref.getAnnotations (annos);
|
||||
@@ -370,7 +360,7 @@ bool DOM::get (const std::string& name, const Task& task, Variant& value)
|
||||
int count = 0;
|
||||
|
||||
// Count off the 'a'th annotation.
|
||||
for (auto& i : annos)
|
||||
for (const auto& i : annos)
|
||||
{
|
||||
if (++count == a)
|
||||
{
|
||||
@@ -398,7 +388,7 @@ bool DOM::get (const std::string& name, const Task& task, Variant& value)
|
||||
}
|
||||
|
||||
// Delegate to the context-free version of DOM::get.
|
||||
return this->get (name, value);
|
||||
return getDOM (name, value);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
17
src/DOM.h
17
src/DOM.h
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -30,19 +30,8 @@
|
||||
#include <string>
|
||||
#include <Variant.h>
|
||||
#include <Task.h>
|
||||
#include <time.h>
|
||||
|
||||
class DOM
|
||||
{
|
||||
public:
|
||||
DOM ();
|
||||
~DOM ();
|
||||
|
||||
bool get (const std::string&, Variant&);
|
||||
bool get (const std::string&, const Task&, Variant&);
|
||||
|
||||
private:
|
||||
};
|
||||
bool getDOM (const std::string&, Variant&);
|
||||
bool getDOM (const std::string&, const Task&, Variant&);
|
||||
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2013 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2013 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -25,11 +25,11 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <Dates.h>
|
||||
#include <algorithm>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <text.h>
|
||||
#include <Dates.h>
|
||||
#include <ISO8601.h>
|
||||
#include <Lexer.h>
|
||||
#include <CLI2.h>
|
||||
@@ -387,12 +387,12 @@ bool namedDates (const std::string& name, Variant& value)
|
||||
if (Lexer::isDigit (name[1]))
|
||||
{
|
||||
number = strtol (name.substr (0, 2).c_str (), NULL, 10);
|
||||
ordinal = lowerCase (name.substr (2));
|
||||
ordinal = Lexer::lowerCase (name.substr (2));
|
||||
}
|
||||
else
|
||||
{
|
||||
number = strtol (name.substr (0, 1).c_str (), NULL, 10);
|
||||
ordinal = lowerCase (name.substr (1));
|
||||
ordinal = Lexer::lowerCase (name.substr (1));
|
||||
}
|
||||
|
||||
// Sanity check.
|
||||
@@ -440,11 +440,7 @@ bool namedDates (const std::string& name, Variant& value)
|
||||
value = Variant (mktime (t), Variant::type_date);
|
||||
}
|
||||
}
|
||||
else
|
||||
throw std::string (STRING_DATES_ORD_MISMATCH);
|
||||
}
|
||||
else
|
||||
throw std::string (STRING_DATES_MONTH_31);
|
||||
}
|
||||
|
||||
else if (closeEnough ("easter", name, minimum) ||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2013 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2013 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
41
src/Eval.cpp
41
src/Eval.cpp
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2013 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2013 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -25,12 +25,12 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <Eval.h>
|
||||
#include <map>
|
||||
#include <time.h>
|
||||
#include <Context.h>
|
||||
#include <Task.h>
|
||||
#include <Color.h>
|
||||
#include <Eval.h>
|
||||
#include <text.h>
|
||||
#include <i18n.h>
|
||||
|
||||
@@ -104,16 +104,10 @@ static bool namedConstants (const std::string& name, Variant& value)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Eval::Eval ()
|
||||
: _debug (false)
|
||||
{
|
||||
addSource (namedConstants);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Eval::~Eval ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Eval::addSource (bool (*source)(const std::string&, Variant&))
|
||||
{
|
||||
@@ -165,33 +159,6 @@ void Eval::evaluatePostfixExpression (const std::string& e, Variant& v) const
|
||||
evaluatePostfixStack (tokens, v);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Eval::compileExpression (const std::string& e)
|
||||
{
|
||||
// Reduce e to a vector of tokens.
|
||||
Lexer l (e);
|
||||
std::string token;
|
||||
Lexer::Type type;
|
||||
while (l.token (token, type))
|
||||
{
|
||||
if (_debug)
|
||||
context.debug ("Lexer '" + token + "' " + Lexer::typeToString (type));
|
||||
_compiled.push_back (std::pair <std::string, Lexer::Type> (token, type));
|
||||
}
|
||||
|
||||
// Parse for syntax checking and operator replacement.
|
||||
if (_debug)
|
||||
context.debug ("[1;37;42mFILTER[0m Infix " + dump (_compiled));
|
||||
infixParse (_compiled);
|
||||
if (_debug)
|
||||
context.debug ("[1;37;42mFILTER[0m Infix parsed " + dump (_compiled));
|
||||
|
||||
// Convert infix --> postfix.
|
||||
infixToPostfix (_compiled);
|
||||
if (_debug)
|
||||
context.debug ("[1;37;42mFILTER[0m Postfix " + dump (_compiled));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Eval::compileExpression (
|
||||
const std::vector <std::pair <std::string, Lexer::Type>>& precompiled)
|
||||
@@ -257,8 +224,7 @@ void Eval::evaluatePostfixStack (
|
||||
|
||||
// This is stack used by the postfix evaluator.
|
||||
std::vector <Variant> values;
|
||||
|
||||
for (auto& token : tokens)
|
||||
for (const auto& token : tokens)
|
||||
{
|
||||
// Unary operators.
|
||||
if (token.second == Lexer::Type::op &&
|
||||
@@ -893,4 +859,3 @@ std::string Eval::dump (
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
17
src/Eval.h
17
src/Eval.h
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2013 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2013 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -36,15 +36,10 @@ class Eval
|
||||
{
|
||||
public:
|
||||
Eval ();
|
||||
virtual ~Eval ();
|
||||
Eval (const Eval&); // Not implemented.
|
||||
Eval& operator= (const Eval&); // Not implemented.
|
||||
bool operator== (const Eval&); // Not implemented.
|
||||
|
||||
void addSource (bool (*fn)(const std::string&, Variant&));
|
||||
void evaluateInfixExpression (const std::string&, Variant&) const;
|
||||
void evaluatePostfixExpression (const std::string&, Variant&) const;
|
||||
void compileExpression (const std::string&);
|
||||
void compileExpression (const std::vector <std::pair <std::string, Lexer::Type>>&);
|
||||
void evaluateCompiledExpression (Variant&);
|
||||
void debug (bool);
|
||||
@@ -71,13 +66,9 @@ private:
|
||||
std::string dump (std::vector <std::pair <std::string, Lexer::Type>>&) const;
|
||||
|
||||
private:
|
||||
std::vector <bool (*)(const std::string&, Variant&)> _sources;
|
||||
bool _debug;
|
||||
std::vector <std::pair <std::string, Lexer::Type>> _compiled;
|
||||
std::vector <bool (*)(const std::string&, Variant&)> _sources {};
|
||||
bool _debug {false};
|
||||
std::vector <std::pair <std::string, Lexer::Type>> _compiled {};
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
244
src/FS.cpp
244
src/FS.cpp
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -25,27 +25,30 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <FS.h>
|
||||
#include <fstream>
|
||||
#include <glob.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <dirent.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
#include <FS.h>
|
||||
|
||||
#if defined SOLARIS || defined NETBSD || defined FREEBSD
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#if defined __APPLE__
|
||||
#include <sys/syslimits.h>
|
||||
#endif
|
||||
|
||||
// Fixes build with musl libc.
|
||||
#ifndef GLOB_TILDE
|
||||
#define GLOB_TILDE 0
|
||||
@@ -55,13 +58,6 @@
|
||||
#define GLOB_BRACE 0
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::ostream& operator<< (std::ostream& out, const Path& path)
|
||||
{
|
||||
out << path._data;
|
||||
return out;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Path::Path ()
|
||||
{
|
||||
@@ -84,11 +80,6 @@ Path::Path (const std::string& in)
|
||||
_data = expand (in);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Path::~Path ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Path& Path::operator= (const Path& other)
|
||||
{
|
||||
@@ -217,10 +208,10 @@ bool Path::executable () const
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Path::rename (const std::string& new_name)
|
||||
{
|
||||
std::string expanded = expand (new_name);
|
||||
auto expanded = expand (new_name);
|
||||
if (_data != expanded)
|
||||
{
|
||||
if (::rename (_data.c_str (), expanded.c_str ()) == 0)
|
||||
if (std::rename (_data.c_str (), expanded.c_str ()) == 0)
|
||||
{
|
||||
_data = expanded;
|
||||
return true;
|
||||
@@ -246,7 +237,7 @@ std::string Path::expand (const std::string& in)
|
||||
if (tilde != std::string::npos)
|
||||
{
|
||||
const char *home = getenv("HOME");
|
||||
if (home == NULL)
|
||||
if (home == nullptr)
|
||||
{
|
||||
struct passwd* pw = getpwuid (getuid ());
|
||||
home = pw->pw_dir;
|
||||
@@ -277,7 +268,7 @@ std::string Path::expand (const std::string& in)
|
||||
else if (in.length () > 2 &&
|
||||
in.substr (0, 2) == "./")
|
||||
{
|
||||
copy = Directory::cwd () + "/" + in.substr (2);
|
||||
copy = Directory::cwd () + in.substr (1);
|
||||
}
|
||||
else if (in.length () > 1 &&
|
||||
in[0] != '.' &&
|
||||
@@ -296,9 +287,9 @@ std::vector <std::string> Path::glob (const std::string& pattern)
|
||||
|
||||
glob_t g;
|
||||
#ifdef SOLARIS
|
||||
if (!::glob (pattern.c_str (), GLOB_ERR, NULL, &g))
|
||||
if (!::glob (pattern.c_str (), GLOB_ERR, nullptr, &g))
|
||||
#else
|
||||
if (!::glob (pattern.c_str (), GLOB_ERR | GLOB_BRACE | GLOB_TILDE, NULL, &g))
|
||||
if (!::glob (pattern.c_str (), GLOB_ERR | GLOB_BRACE | GLOB_TILDE, nullptr, &g))
|
||||
#endif
|
||||
for (int i = 0; i < (int) g.gl_pathc; ++i)
|
||||
results.push_back (g.gl_pathv[i]);
|
||||
@@ -310,7 +301,7 @@ std::vector <std::string> Path::glob (const std::string& pattern)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
File::File ()
|
||||
: Path::Path ()
|
||||
, _fh (NULL)
|
||||
, _fh (nullptr)
|
||||
, _h (-1)
|
||||
, _locked (false)
|
||||
{
|
||||
@@ -319,7 +310,7 @@ File::File ()
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
File::File (const Path& other)
|
||||
: Path::Path (other)
|
||||
, _fh (NULL)
|
||||
, _fh (nullptr)
|
||||
, _h (-1)
|
||||
, _locked (false)
|
||||
{
|
||||
@@ -328,7 +319,7 @@ File::File (const Path& other)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
File::File (const File& other)
|
||||
: Path::Path (other)
|
||||
, _fh (NULL)
|
||||
, _fh (nullptr)
|
||||
, _h (-1)
|
||||
, _locked (false)
|
||||
{
|
||||
@@ -337,7 +328,7 @@ File::File (const File& other)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
File::File (const std::string& in)
|
||||
: Path::Path (in)
|
||||
, _fh (NULL)
|
||||
, _fh (nullptr)
|
||||
, _h (-1)
|
||||
, _locked (false)
|
||||
{
|
||||
@@ -379,6 +370,17 @@ bool File::remove () const
|
||||
return unlink (_data.c_str ()) == 0 ? true : false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string File::removeBOM (const std::string& input)
|
||||
{
|
||||
if (input[0] && input[0] == '\xEF' &&
|
||||
input[1] && input[1] == '\xBB' &&
|
||||
input[2] && input[2] == '\xBF')
|
||||
return input.substr (3);
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool File::open ()
|
||||
{
|
||||
@@ -406,12 +408,6 @@ bool File::open ()
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool File::openAndLock ()
|
||||
{
|
||||
return open () && lock ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void File::close ()
|
||||
{
|
||||
@@ -421,7 +417,7 @@ void File::close ()
|
||||
unlock ();
|
||||
|
||||
fclose (_fh);
|
||||
_fh = NULL;
|
||||
_fh = nullptr;
|
||||
_h = -1;
|
||||
_locked = false;
|
||||
}
|
||||
@@ -467,10 +463,20 @@ void File::read (std::string& contents)
|
||||
std::ifstream in (_data.c_str ());
|
||||
if (in.good ())
|
||||
{
|
||||
bool first = true;
|
||||
std::string line;
|
||||
line.reserve (512 * 1024);
|
||||
while (getline (in, line))
|
||||
{
|
||||
// Detect forbidden BOM on first line.
|
||||
if (first)
|
||||
{
|
||||
line = File::removeBOM (line);
|
||||
first = false;
|
||||
}
|
||||
|
||||
contents += line + "\n";
|
||||
}
|
||||
|
||||
in.close ();
|
||||
}
|
||||
@@ -485,40 +491,25 @@ void File::read (std::vector <std::string>& contents)
|
||||
std::ifstream in (_data.c_str ());
|
||||
if (in.good ())
|
||||
{
|
||||
bool first = true;
|
||||
std::string line;
|
||||
line.reserve (512 * 1024);
|
||||
while (getline (in, line))
|
||||
{
|
||||
// Detect forbidden BOM on first line.
|
||||
if (first)
|
||||
{
|
||||
line = File::removeBOM (line);
|
||||
first = false;
|
||||
}
|
||||
|
||||
contents.push_back (line);
|
||||
}
|
||||
|
||||
in.close ();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Opens if necessary.
|
||||
void File::write (const std::string& line)
|
||||
{
|
||||
if (!_fh)
|
||||
open ();
|
||||
|
||||
if (_fh)
|
||||
fputs (line.c_str (), _fh);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Opens if necessary.
|
||||
void File::write (const std::vector <std::string>& lines)
|
||||
{
|
||||
if (!_fh)
|
||||
open ();
|
||||
|
||||
if (_fh)
|
||||
{
|
||||
for (auto& line : lines)
|
||||
fputs (line.c_str (), _fh);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Opens if necessary.
|
||||
void File::append (const std::string& line)
|
||||
@@ -544,10 +535,20 @@ void File::append (const std::vector <std::string>& lines)
|
||||
{
|
||||
fseek (_fh, 0, SEEK_END);
|
||||
for (auto& line : lines)
|
||||
fputs ((line + "\n").c_str (), _fh);
|
||||
fputs (line.c_str (), _fh);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void File::write_raw (const std::string& line)
|
||||
{
|
||||
if (!_fh)
|
||||
open ();
|
||||
|
||||
if (_fh)
|
||||
fputs (line.c_str (), _fh);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void File::truncate ()
|
||||
{
|
||||
@@ -555,7 +556,7 @@ void File::truncate ()
|
||||
open ();
|
||||
|
||||
if (_fh)
|
||||
ftruncate (_h, 0);
|
||||
(void) ftruncate (_h, 0);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -642,25 +643,6 @@ bool File::create (const std::string& name, int mode /* = 0640 */)
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string File::read (const std::string& name)
|
||||
{
|
||||
std::string contents = "";
|
||||
|
||||
std::ifstream in (name.c_str ());
|
||||
if (in.good ())
|
||||
{
|
||||
std::string line;
|
||||
line.reserve (1024);
|
||||
while (getline (in, line))
|
||||
contents += line + "\n";
|
||||
|
||||
in.close ();
|
||||
}
|
||||
|
||||
return contents;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool File::read (const std::string& name, std::string& contents)
|
||||
{
|
||||
@@ -669,10 +651,20 @@ bool File::read (const std::string& name, std::string& contents)
|
||||
std::ifstream in (name.c_str ());
|
||||
if (in.good ())
|
||||
{
|
||||
bool first = true;
|
||||
std::string line;
|
||||
line.reserve (1024);
|
||||
while (getline (in, line))
|
||||
{
|
||||
// Detect forbidden BOM on first line.
|
||||
if (first)
|
||||
{
|
||||
line = File::removeBOM (line);
|
||||
first = false;
|
||||
}
|
||||
|
||||
contents += line + "\n";
|
||||
}
|
||||
|
||||
in.close ();
|
||||
return true;
|
||||
@@ -689,10 +681,20 @@ bool File::read (const std::string& name, std::vector <std::string>& contents)
|
||||
std::ifstream in (name.c_str ());
|
||||
if (in.good ())
|
||||
{
|
||||
bool first = true;
|
||||
std::string line;
|
||||
line.reserve (1024);
|
||||
while (getline (in, line))
|
||||
{
|
||||
// Detect forbidden BOM on first line.
|
||||
if (first)
|
||||
{
|
||||
line = File::removeBOM (line);
|
||||
first = false;
|
||||
}
|
||||
|
||||
contents.push_back (line);
|
||||
}
|
||||
|
||||
in.close ();
|
||||
return true;
|
||||
@@ -741,52 +743,39 @@ bool File::write (
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool File::append (const std::string& name, const std::string& contents)
|
||||
{
|
||||
std::ofstream out (expand (name).c_str (),
|
||||
std::ios_base::out | std::ios_base::app);
|
||||
if (out.good ())
|
||||
{
|
||||
out << contents;
|
||||
out.close ();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool File::append (
|
||||
const std::string& name,
|
||||
const std::vector <std::string>& lines,
|
||||
bool addNewlines /* = true */)
|
||||
{
|
||||
std::ofstream out (expand (name).c_str (),
|
||||
std::ios_base::out | std::ios_base::app);
|
||||
if (out.good ())
|
||||
{
|
||||
for (auto& line : lines)
|
||||
{
|
||||
out << line;
|
||||
|
||||
if (addNewlines)
|
||||
out << "\n";
|
||||
}
|
||||
|
||||
out.close ();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool File::remove (const std::string& name)
|
||||
{
|
||||
return unlink (expand (name).c_str ()) == 0 ? true : false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool File::copy (const std::string& from, const std::string& to)
|
||||
{
|
||||
// 'from' must exist.
|
||||
if (! access (from.c_str (), F_OK))
|
||||
{
|
||||
std::ifstream src (from, std::ios::binary);
|
||||
std::ofstream dst (to, std::ios::binary);
|
||||
|
||||
dst << src.rdbuf ();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool File::move (const std::string& from, const std::string& to)
|
||||
{
|
||||
auto expanded = expand (to);
|
||||
if (from != expanded)
|
||||
if (std::rename (from.c_str (), to.c_str ()) == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Directory::Directory ()
|
||||
{
|
||||
@@ -816,18 +805,11 @@ Directory::Directory (const std::string& in)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Directory::~Directory ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Directory& Directory::operator= (const Directory& other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
File::operator= (other);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -848,10 +830,10 @@ bool Directory::remove () const
|
||||
bool Directory::remove_directory (const std::string& dir) const
|
||||
{
|
||||
DIR* dp = opendir (dir.c_str ());
|
||||
if (dp != NULL)
|
||||
if (dp != nullptr)
|
||||
{
|
||||
struct dirent* de;
|
||||
while ((de = readdir (dp)) != NULL)
|
||||
while ((de = readdir (dp)) != nullptr)
|
||||
{
|
||||
if (!strcmp (de->d_name, ".") ||
|
||||
!strcmp (de->d_name, ".."))
|
||||
@@ -906,7 +888,7 @@ std::string Directory::cwd ()
|
||||
{
|
||||
#ifdef HAVE_GET_CURRENT_DIR_NAME
|
||||
char *buf = get_current_dir_name ();
|
||||
if (buf == NULL)
|
||||
if (buf == nullptr)
|
||||
throw std::bad_alloc ();
|
||||
std::string result (buf);
|
||||
free (buf);
|
||||
@@ -952,10 +934,10 @@ void Directory::list (
|
||||
bool recursive)
|
||||
{
|
||||
DIR* dp = opendir (base.c_str ());
|
||||
if (dp != NULL)
|
||||
if (dp != nullptr)
|
||||
{
|
||||
struct dirent* de;
|
||||
while ((de = readdir (dp)) != NULL)
|
||||
while ((de = readdir (dp)) != nullptr)
|
||||
{
|
||||
if (!strcmp (de->d_name, ".") ||
|
||||
!strcmp (de->d_name, ".."))
|
||||
|
||||
31
src/FS.h
31
src/FS.h
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -36,9 +36,8 @@ class Path
|
||||
{
|
||||
public:
|
||||
Path ();
|
||||
Path (const Path&);
|
||||
explicit Path (const Path&);
|
||||
Path (const std::string&);
|
||||
virtual ~Path ();
|
||||
|
||||
Path& operator= (const Path&);
|
||||
bool operator== (const Path&);
|
||||
@@ -70,8 +69,8 @@ class File : public Path
|
||||
{
|
||||
public:
|
||||
File ();
|
||||
File (const Path&);
|
||||
File (const File&);
|
||||
explicit File (const Path&);
|
||||
explicit File (const File&);
|
||||
File (const std::string&);
|
||||
virtual ~File ();
|
||||
|
||||
@@ -81,7 +80,6 @@ public:
|
||||
virtual bool remove () const;
|
||||
|
||||
bool open ();
|
||||
bool openAndLock ();
|
||||
void close ();
|
||||
|
||||
bool lock ();
|
||||
@@ -90,11 +88,9 @@ public:
|
||||
void read (std::string&);
|
||||
void read (std::vector <std::string>&);
|
||||
|
||||
void write (const std::string&);
|
||||
void write (const std::vector <std::string>&);
|
||||
|
||||
void append (const std::string&);
|
||||
void append (const std::vector <std::string>&);
|
||||
void write_raw (const std::string&);
|
||||
|
||||
void truncate ();
|
||||
|
||||
@@ -105,14 +101,14 @@ public:
|
||||
virtual time_t btime () const;
|
||||
|
||||
static bool create (const std::string&, int mode = 0640);
|
||||
static std::string read (const std::string&);
|
||||
static bool read (const std::string&, std::string&);
|
||||
static bool read (const std::string&, std::vector <std::string>&);
|
||||
static bool write (const std::string&, const std::string&);
|
||||
static bool write (const std::string&, const std::vector <std::string>&, bool addNewlines = true);
|
||||
static bool append (const std::string&, const std::string&);
|
||||
static bool append (const std::string&, const std::vector <std::string>&, bool addNewlines = true);
|
||||
static bool remove (const std::string&);
|
||||
static bool copy (const std::string&, const std::string&);
|
||||
static bool move (const std::string&, const std::string&);
|
||||
static std::string removeBOM (const std::string&);
|
||||
|
||||
private:
|
||||
FILE* _fh;
|
||||
@@ -124,11 +120,10 @@ class Directory : public File
|
||||
{
|
||||
public:
|
||||
Directory ();
|
||||
Directory (const Directory&);
|
||||
Directory (const File&);
|
||||
Directory (const Path&);
|
||||
explicit Directory (const Directory&);
|
||||
explicit Directory (const File&);
|
||||
explicit Directory (const Path&);
|
||||
Directory (const std::string&);
|
||||
virtual ~Directory ();
|
||||
|
||||
Directory& operator= (const Directory&);
|
||||
|
||||
@@ -147,8 +142,4 @@ private:
|
||||
bool remove_directory (const std::string&) const;
|
||||
};
|
||||
|
||||
std::ostream& operator<< (std::ostream&, const Path&);
|
||||
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -25,12 +25,13 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <Filter.h>
|
||||
#include <algorithm>
|
||||
#include <Context.h>
|
||||
#include <DOM.h>
|
||||
#include <Eval.h>
|
||||
#include <Variant.h>
|
||||
#include <Dates.h>
|
||||
#include <Filter.h>
|
||||
#include <i18n.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
@@ -45,7 +46,7 @@ Task& contextTask = dummy;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool domSource (const std::string& identifier, Variant& value)
|
||||
{
|
||||
if (context.dom.get (identifier, contextTask, value))
|
||||
if (getDOM (identifier, contextTask, value))
|
||||
{
|
||||
value.source (identifier);
|
||||
return true;
|
||||
@@ -54,19 +55,6 @@ bool domSource (const std::string& identifier, Variant& value)
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Filter::Filter ()
|
||||
: _startCount (0)
|
||||
, _endCount (0)
|
||||
, _safety (true)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Filter::~Filter ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Take an input set of tasks and filter into a subset.
|
||||
void Filter::subset (const std::vector <Task>& input, std::vector <Task>& output)
|
||||
@@ -199,40 +187,20 @@ void Filter::subset (std::vector <Task>& output)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Filter::hasFilter ()
|
||||
bool Filter::hasFilter () const
|
||||
{
|
||||
for (auto& a : context.cli2._args)
|
||||
for (const auto& a : context.cli2._args)
|
||||
if (a.hasTag ("FILTER"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Filter::hasModifications ()
|
||||
{
|
||||
for (auto& a : context.cli2._args)
|
||||
if (a.hasTag ("MODIFICATION"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Filter::hasMiscellaneous ()
|
||||
{
|
||||
for (auto& a : context.cli2._args)
|
||||
if (a.hasTag ("MISCELLANEOUS"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// If the filter contains no 'or', 'xor' or 'not' operators, and only includes
|
||||
// status values 'pending', 'waiting' or 'recurring', then the filter is
|
||||
// guaranteed to only need data from pending.data.
|
||||
bool Filter::pendingOnly ()
|
||||
bool Filter::pendingOnly () const
|
||||
{
|
||||
// When GC is off, there are no shortcuts.
|
||||
if (! context.config.getBoolean ("gc"))
|
||||
@@ -254,7 +222,7 @@ bool Filter::pendingOnly ()
|
||||
int countXor = 0;
|
||||
int countNot = 0;
|
||||
|
||||
for (auto& a : context.cli2._args)
|
||||
for (const auto& a : context.cli2._args)
|
||||
{
|
||||
if (a.hasTag ("FILTER"))
|
||||
{
|
||||
@@ -294,31 +262,35 @@ bool Filter::pendingOnly ()
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Disaster avoidance mechanism. If a !READONLY has no filter, then it can cause
|
||||
// all tasks to be modified. This is usually not intended.
|
||||
void Filter::safety ()
|
||||
void Filter::safety () const
|
||||
{
|
||||
if (_safety)
|
||||
{
|
||||
for (auto& a : context.cli2._args)
|
||||
bool readonly = true;
|
||||
bool filter = false;
|
||||
for (const auto& a : context.cli2._args)
|
||||
{
|
||||
if (a.hasTag ("CMD"))
|
||||
{
|
||||
if (! a.hasTag ("READONLY"))
|
||||
{
|
||||
if (! context.config.getBoolean ("allow.empty.filter"))
|
||||
throw std::string (STRING_TASK_SAFETY_ALLOW);
|
||||
if (a.hasTag ("CMD") &&
|
||||
! a.hasTag ("READONLY"))
|
||||
readonly = false;
|
||||
|
||||
// If user is willing to be asked, this can be avoided.
|
||||
if (context.config.getBoolean ("confirmation") &&
|
||||
confirm (STRING_TASK_SAFETY_VALVE))
|
||||
return;
|
||||
if (a.hasTag ("FILTER"))
|
||||
filter = true;
|
||||
}
|
||||
|
||||
// Sounds the alarm.
|
||||
throw std::string (STRING_TASK_SAFETY_FAIL);
|
||||
}
|
||||
if (! readonly &&
|
||||
! filter)
|
||||
{
|
||||
if (! context.config.getBoolean ("allow.empty.filter"))
|
||||
throw std::string (STRING_TASK_SAFETY_ALLOW);
|
||||
|
||||
// CMD was found.
|
||||
// If user is willing to be asked, this can be avoided.
|
||||
if (context.config.getBoolean ("confirmation") &&
|
||||
confirm (STRING_TASK_SAFETY_VALVE))
|
||||
return;
|
||||
}
|
||||
|
||||
// Sound the alarm.
|
||||
throw std::string (STRING_TASK_SAFETY_FAIL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user