Compare commits

..

524 Commits

Author SHA1 Message Date
Federico Hernandez
8b4ae3b54b Version number and release date for 2.5.1 2016-02-24 23:17:29 +01:00
Paul Beckingham
716936acaa Text: Fixed extractLines where hyphenation is off 2016-02-23 22:15:00 -05:00
Paul Beckingham
db3cfc939d ColTags: Added missing calculation for tag max width 2016-02-23 21:56:23 -05:00
Paul Beckingham
c6a6f04697 ColProject: Use of const 2016-02-23 21:43:44 -05:00
Paul Beckingham
f2863c50b4 ColDepends: Use of const 2016-02-23 21:41:57 -05:00
Paul Beckingham
7c82c44759 TW-1773: one task eaten all my RAM
- Thanks to Yaroslav Molochko.
2016-02-23 21:16:01 -05:00
Paul Beckingham
7efbfe29e4 Tests: Added extractLine tests 2016-02-23 21:11:22 -05:00
Paul Beckingham
f1785c6da9 Text: Justification auto-truncates 2016-02-23 21:10:41 -05:00
Paul Beckingham
029f3af578 TW-1709: Parsing bug when doing "task undo"
- Thanks to Scott Kostyshak.
2016-02-23 21:05:53 -05:00
Paul Beckingham
31f0804207 ColDescription: Minimized use of wrapText
- This is a high-use measure/render method pair, and needs to be quick.
2016-02-23 20:55:45 -05:00
Paul Beckingham
fa035c3fde ColTags: Reduced total work
- When there is only a single tag, there is no need to split, sort and word wrap.
2016-02-23 08:39:03 -05:00
Paul Beckingham
0a0793b2ca dependency: No point scanning for circularity on 'add' 2016-02-22 22:52:11 -05:00
Paul Beckingham
774cf3e2d9 Tests: Fixed import/export tests that assumed a default value
- Instead of settting the value.
2016-02-21 11:16:19 -05:00
Paul Beckingham
140accc3d7 FS: Modified so that newlines are no longer added
- Now consistent with Taskserver and Common, and actually what we started
  with.
2016-02-21 11:04:13 -05:00
Paul Beckingham
29a7837fda TD-104: Unrecognized taskwarrior file format
- Thanks to Jeremy John Reeder, Reg.
2016-02-21 10:13:21 -05:00
Paul Beckingham
6ceca1d424 FS: Inherited fixes from Taskserver 2016-02-20 23:44:20 -05:00
Paul Beckingham
5666feaab9 CFS, Msg, ViewText: Code cleanup 2016-02-20 23:10:23 -05:00
Paul Beckingham
a1dbb0c294 Perofrmance: Removed redundant parsing in ISO8601d 2016-02-13 11:49:03 -05:00
Fidel Mato
3a9e128c4a L10N
- Corrections and newly translated strings from eng-USA to esp-ESP.
2016-02-11 15:11:30 -05:00
Paul Beckingham
28810447d1 TW-1768: Task sync failed: "Either your credentials are incorrect, or your account doesn't exist on the Taskserver."
- Thanks to Konstantin.
2016-02-08 22:54:41 -05:00
Tomas Babej
72f8fec136 CmdAdd: Display a specific feedback message for recurrence template tasks 2016-02-06 12:24:45 -05:00
Paul Beckingham
724a4a02a0 Code formatting 2016-02-06 12:13:19 -05:00
Paul Beckingham
cfd997111b Tests: The 'run_all' script was not correctly using exit code 0 when all tests pass
- Thanks to Gordon Ball.
2016-02-06 12:08:31 -05:00
Paul Beckingham
9b5c0c81a3 Build: Included 'problems' script in build dir
- Thanks to Gordon Ball.
2016-02-06 12:08:31 -05:00
Federico Hernandez
2ca3fd5f3c Taskwarrior 2.5.1 Beta 1 2016-02-05 23:18:02 +01:00
Paul Beckingham
5e4d387d83 Diagnostics: Added missing \n characters 2016-02-04 15:46:59 -05:00
Paul Beckingham
820cc4b2e5 DOM: Demoted from class to functions
- The DOM object contains no members, and only two (effectively) const methods.
  Demoting DOM to function calls reduces coupling with Context.
2016-02-03 21:54:37 -05:00
Paul Beckingham
ec4e6af00d CLI2: C++11 2016-02-03 21:44:28 -05:00
Paul Beckingham
3b82be9c16 Filter: C++11 2016-02-03 21:12:18 -05:00
Paul Beckingham
cdd1c4681d Hooks: C++11 2016-02-03 21:06:49 -05:00
Paul Beckingham
c25f312477 ColTypeString: Removed obsolete code 2016-02-03 20:41:19 -05:00
Paul Beckingham
8be1c53d92 ColTypeNumeric: Removed obsolete code 2016-02-03 20:40:59 -05:00
Paul Beckingham
1fced1b8a9 ColTypeDuration: Removed obsolete code 2016-02-03 20:40:34 -05:00
Paul Beckingham
197b440cc2 Eval: C++11 2016-02-03 20:30:57 -05:00
Paul Beckingham
96f04ffc25 Variant: C++11 2016-02-03 20:22:30 -05:00
Paul Beckingham
f59e15185f Timer: C++11 2016-02-03 20:14:17 -05:00
Paul Beckingham
8577449960 FS: C++11 2016-02-03 19:58:22 -05:00
Paul Beckingham
9720e7dab4 Msg: C++11 2016-02-03 19:47:34 -05:00
Paul Beckingham
1579705fec Color: C++11 2016-02-03 19:39:38 -05:00
Paul Beckingham
4d2c97f2c3 RX: C++11 2016-02-03 19:26:52 -05:00
Paul Beckingham
073ff9032d TW-1754: '\' at end of description in 'task edit' merges task with following task
- Thanks to Scott Kostyshak.
2016-02-02 23:35:30 -05:00
Paul Beckingham
b61471ca0e TW-1710: Setting wait date on status:completed / status:deleted
- Thanks to Daniel Shahaf.
2016-02-02 23:24:06 -05:00
Paul Beckingham
8275181022 Task: ::getStatus no longer autovivifies 2016-02-02 23:23:14 -05:00
Paul Beckingham
f2abdfd562 Tests: Added Lexer::Type::pair test 2016-02-02 22:39:53 -05:00
Paul Beckingham
a8ed0e7d55 Test: Fixed test that still assumed Cygwin & FreeBSD has 16-color default themes 2016-02-02 01:39:36 -05:00
Paul Beckingham
f6a7a8720e TW-1697: Inconsistent failure mode on invalid task id
- Thanks to Daniel Shahaf.
2016-02-02 01:29:22 -05:00
Paul Beckingham
ea82d88816 Tests: Added test for TW-1763 2016-02-02 01:07:47 -05:00
Paul Beckingham
1187ad16cc CmdModify: Code cleanup 2016-02-02 01:04:40 -05:00
Paul Beckingham
63bbe857c8 Config: No longer autovivifies 2016-02-02 01:04:22 -05:00
Paul Beckingham
23ac9895ab TW-1763: Removing the due date of a task with no due date modifies the task
- Thanks to Scott Kostyshak.
2016-02-02 01:03:19 -05:00
Paul Beckingham
4b37fea21f ColTypeString: Added validate() in ::modify 2016-02-01 23:59:18 -05:00
Paul Beckingham
db7ebf9029 Column: Made ::validate const 2016-02-01 23:56:39 -05:00
Paul Beckingham
575433542f ColProject: Special ::modify handling for 'project' 2016-02-01 23:38:32 -05:00
Paul Beckingham
7ae5e4657d Column: Only fail when an invalid UDA type is found
- Previously it was failing for a missing type, so that if a UDA was not
  completely defined, there was an unexpected error. This is because the
  setting uda.foo.label was enough to make Column extract 'foo', but then
  fail to extract uda.foo.type.
2016-02-01 18:43:47 -05:00
Paul Beckingham
309ee57783 Column: Only store UDA column objects that instantiate 2016-02-01 18:43:10 -05:00
Paul Beckingham
11b7d2edbf Column: Uses const loop iterators 2016-02-01 18:42:25 -05:00
Paul Beckingham
4f7805d005 Column: Uses non-auto-vivifying Config::has 2016-02-01 18:41:36 -05:00
Paul Beckingham
a356d14f0c ColUDA: Removed hyphenation from types that don't hyphenate 2016-02-01 18:40:30 -05:00
Paul Beckingham
cf473863d9 Tests: Added specific error wording
- Also removed uppercase attribute names.
2016-02-01 18:38:57 -05:00
Paul Beckingham
32cf553d4e TW-188: short help text
- Thanks to David Patrick.
2016-02-01 18:38:14 -05:00
Paul Beckingham
ba957344ef Task: Specialized modification code replaced by Column::modify delegate 2016-02-01 01:11:21 -05:00
Paul Beckingham
6f4f468d0d ColUDA: Split ColUDA into ColUDA{String,Numeric,Date,Duration} to make use of ColType*::modify 2016-02-01 01:10:11 -05:00
Paul Beckingham
73d789c593 ColTypeNumeric: Code cleanup 2016-02-01 00:40:28 -05:00
Paul Beckingham
c167fa665e Column: Reduced ::modify to a minimal implementation 2016-02-01 00:33:22 -05:00
Paul Beckingham
264fd264e9 Tests: Code cleanup 2016-02-01 00:31:06 -05:00
Paul Beckingham
6a0960174f TW-1756: The columns.t unit test fails two tests after 2300 local 2016-01-31 23:48:02 -05:00
Paul Beckingham
3957c3567a ColTypeString: Migrated part of Task::modify to ::modify 2016-01-31 20:09:10 -05:00
Paul Beckingham
7525d4a921 ColTypeNumeric: Migrated part of Task::modify to ::modify 2016-01-31 20:08:51 -05:00
Paul Beckingham
b7a72c5252 ColTypeDuration: Migrated part of Task::modify to ::modify 2016-01-31 20:08:32 -05:00
Paul Beckingham
82b5c27fe8 ColTypeDate: Migrated part of Task::modify to ::modify 2016-01-31 20:06:30 -05:00
Paul Beckingham
99aaa4cc80 Task: Prepared Task::modify for switch to delegated Column::modify 2016-01-31 20:05:28 -05:00
Paul Beckingham
7c8b3c9699 Task: Removed dead code, fixed comments 2016-01-31 19:40:13 -05:00
Paul Beckingham
6e56849bce Task: Migrated part of ::modify to ColRecur 2016-01-31 19:28:23 -05:00
Paul Beckingham
fec65a0f24 ColRecur: Added ::modify 2016-01-31 19:27:54 -05:00
Paul Beckingham
f0b9ceb17b Task: Migrated part of ::modify to ColTags 2016-01-31 17:23:19 -05:00
Paul Beckingham
c6f9d2c4b2 Task: Renamed modCount to mods, we don't need to count them 2016-01-31 17:22:19 -05:00
Paul Beckingham
25d4392edf Task: Migrated part of ::modify to ColDepends 2016-01-31 17:04:45 -05:00
Paul Beckingham
974841883b ColTypeString: Implemented default ::modify 2016-01-31 16:40:39 -05:00
Paul Beckingham
6752695fce ColTypeNumeric: Implemented default ::modify 2016-01-31 16:40:15 -05:00
Paul Beckingham
0043a2fc9e ColTypeDuration: Implemented default ::modify 2016-01-31 16:39:57 -05:00
Paul Beckingham
31e1333c2a ColTypeDate: Implemented default ::modify 2016-01-31 16:39:30 -05:00
Paul Beckingham
5d566ddcbd Column: Added base ::modify method 2016-01-31 16:29:23 -05:00
Paul Beckingham
6ef490a093 Task: Code cleanup 2016-01-31 16:28:13 -05:00
Paul Beckingham
15373daf85 Task: Improved CppCoreGuideline compliance 2016-01-31 16:05:00 -05:00
Paul Beckingham
08b7b5b800 Code Cleanup: Formatting 2016-01-31 16:04:22 -05:00
Paul Beckingham
39cc00ce9d Docs: Fixed man page bugs
- Thanks to pawprint.
2016-01-27 13:39:45 -05:00
Paul Beckingham
dbb0998f9d Tests: All the test certs expired 4 days ago 2016-01-23 15:22:54 -05:00
Paul Beckingham
406f77efe2 Bug: Fixed bug where 'rc.allow.empty.filter' was not behaving properly
- Thanks to Scott Kostyshak.
2016-01-23 15:22:25 -05:00
Paul Beckingham
c023e3e721 Sync: 'init' now uploads pending + completed/deleted tasks 2016-01-23 14:36:02 -05:00
Kent R. Spillner
8337f78efe CMakeLists.txt: find uuid functions on OpenBSD
OpenBSD also includes uuid functions directly in its libc, same as
FreeBSD.

Signed-off-by: Kent R. Spillner <kspillner@acm.org>
2016-01-20 08:00:24 -05:00
Paul Beckingham
097a87a371 Docs: Fixed bad link in docs 2016-01-18 23:40:21 -05:00
Paul Beckingham
2fc1d83b55 C++11: Proper includes 2016-01-16 12:06:20 -05:00
Federico Hernandez
b87a9225eb Build: Added missing include
- Thanks to Ed Rankin
2016-01-16 17:05:22 +01:00
Kent R. Spillner
933b2d8ebe OpenBSD also provides uuid support directly in its libc, same as FreeBSD. 2016-01-15 12:35:10 -05:00
Paul Beckingham
e361c2c751 TW-1719: Description cannot contain improper ordinals
- Thanks to Ben Boeckel.
2016-01-12 00:04:48 -05:00
Paul Beckingham
156357285c Dependency: Consistency
- Modified the ::getBlockingTasks and ::getBlockedTasks to match the code that
  performs the dependency scan. While this doesn't change functionality, it
  does align the logic.
2016-01-11 23:46:22 -05:00
Paul Beckingham
7f3db8f201 TW-1714: Starting recurring task starts all recurrences
- Thanks to Robin Green.
2016-01-11 23:20:33 -05:00
Paul Beckingham
d564aac978 TW-1734: calendar gives an error when context is set
- Thanks to Simon Michael.
2016-01-11 22:44:47 -05:00
Paul Beckingham
60667dbcaa TW-1705: Directories in .task/hooks should not be reported as invalid hooks
- Thanks to Tomas Babej.
2016-01-11 22:30:35 -05:00
Paul Beckingham
19f57ffead TW-1736: Error on detection of BOM in files. 2016-01-11 21:54:57 -05:00
Paul Beckingham
92f22149c0 TW-1735: context with no subcommand should do something
- Thanks to Simon Michael.
2016-01-11 21:05:33 -05:00
Paul Beckingham
3ed7fe265e TW-1752: cleanup of diag output
- Thanks to David Patrick.
2016-01-11 16:27:15 -05:00
Paul Beckingham
df45c84266 TW-1741: Warning "ignoring return value of ‘int ftruncate" while doing make on xubuntu15.10
- Thanks to Sunil Joshi.
2016-01-11 15:26:15 -05:00
Paul Beckingham
3a3cfef0c3 TW-1748: CMakeLists shouldn't hardcode libc++ on Darwin
- Thanks to Misty De Meo.
2016-01-11 14:37:55 -05:00
Paul Beckingham
08233c438a Revert "Column: Removed obsolete method"
This reverts commit 07027abf99.
2016-01-10 00:07:31 -05:00
Paul Beckingham
fb13483cec Revert "Command: Removed obsolete method"
This reverts commit 796ec14c31.
2016-01-10 00:07:07 -05:00
Paul Beckingham
f6ecc08b51 CmdCount: Removed obsolete method 2016-01-09 23:47:05 -05:00
Paul Beckingham
796ec14c31 Command: Removed obsolete method 2016-01-09 23:46:46 -05:00
Paul Beckingham
8a94602eb8 ColWait: Removed obsolete code 2016-01-09 23:26:01 -05:00
Paul Beckingham
8c74495b11 ColUrgency: Removed obsolete code 2016-01-09 23:25:40 -05:00
Paul Beckingham
51badfa4ee ColUntil: Removed obsolete code 2016-01-09 23:21:35 -05:00
Paul Beckingham
08066b694c ColUUID: Removed obsolete code 2016-01-09 23:21:18 -05:00
Paul Beckingham
f89c35f736 ColUDA: Removed obsolete code 2016-01-09 23:20:18 -05:00
Paul Beckingham
3380cac00e ColTypeString: Removed obsolete code 2016-01-09 23:19:48 -05:00
Paul Beckingham
c448dc5b60 ColTypeNumeric: Removed obsolete code 2016-01-09 23:19:28 -05:00
Paul Beckingham
08bc64aeb9 ColTypeDuration: Removed obsolete code 2016-01-09 23:18:35 -05:00
Paul Beckingham
825860488e ColTypeDate: Removed obsolete code 2016-01-09 23:18:15 -05:00
Paul Beckingham
87916eb546 ColTags: Removed obsolete code 2016-01-09 23:17:05 -05:00
Paul Beckingham
b9fe3673fb ColString: Removed obsolete code 2016-01-09 23:16:37 -05:00
Paul Beckingham
1a7adea217 ColStatus: Removed obsolete code 2016-01-09 23:16:02 -05:00
Paul Beckingham
38b04f4632 ColStart: Removed obsolete code 2016-01-09 23:10:06 -05:00
Paul Beckingham
93e80462a1 ColScheduled: Removed obsolete code 2016-01-09 23:09:39 -05:00
Paul Beckingham
80ac338b8d ColRecur: Removed obsolete code 2016-01-09 23:05:16 -05:00
Paul Beckingham
a41839b242 ColProject: Removed obsolete code 2016-01-09 23:04:47 -05:00
Paul Beckingham
926f85ea7c ColParent: Removed obsolete code 2016-01-09 23:04:14 -05:00
Paul Beckingham
383d596516 ColModified: Removed obsolete code 2016-01-09 23:03:02 -05:00
Paul Beckingham
639cd27ef0 ColMask: Removed obsolete code 2016-01-09 23:02:22 -05:00
Paul Beckingham
1b368d5ff9 ColIMask: Removed obsolete code 2016-01-09 22:59:32 -05:00
Paul Beckingham
a084aac4ca ColID: Removed obsolete code 2016-01-09 22:58:24 -05:00
Paul Beckingham
dc2f5425fa ColEntry: Removed obsolete code 2016-01-09 22:56:01 -05:00
Paul Beckingham
bf038b37ac ColEnd: Removed obsolete code 2016-01-09 22:55:24 -05:00
Paul Beckingham
886c030452 ColDue: Removed obsolete code 2016-01-09 22:54:45 -05:00
Paul Beckingham
f011f6e23f ColDescription: Removed obsolete method 2016-01-09 22:53:30 -05:00
Paul Beckingham
a5c4f35e06 ColDepends: Removed obsolete method 2016-01-09 22:52:10 -05:00
Paul Beckingham
07027abf99 Column: Removed obsolete method 2016-01-09 22:41:42 -05:00
Paul Beckingham
08d5db0b49 Hooks: Removed obsolete methods 2016-01-09 22:38:18 -05:00
Paul Beckingham
54fac39f85 Eval: Removed obsolete method 2016-01-09 22:36:13 -05:00
Paul Beckingham
7c5ddee4e5 Filter: Removed obsolete method 2016-01-09 22:34:54 -05:00
Paul Beckingham
88ed4d0035 TDB2: Removed obsolete method 2016-01-09 22:33:06 -05:00
Paul Beckingham
15e96eb02f Color: Removed obsolete methods 2016-01-09 22:29:07 -05:00
Paul Beckingham
da96962b00 Variant: Removed obsolete method 2016-01-09 22:26:58 -05:00
Paul Beckingham
83701168a4 DOM: Remove obsolete methods 2016-01-09 22:24:55 -05:00
Tomas Babej
844cda943a man: Fix invalid context command example 2016-01-08 08:57:41 -05:00
Misty De Meo
33988c2c90 CMakeLists: don't hardcode libc++ on Darwin
Some Darwin users (for example, users on pre-OS X 10.7 systems) use
FSF GCC releases instead of Clang; hardcoding the -stdlib=libc++ flag
causes the build to fail for them. Instead, pass this whenever Clang
is used.
2015-12-31 17:22:05 -05:00
Paul Beckingham
f0c8c7d1b1 TW-1750: REG_ENHANCED, used in RX.cpp, isn't defined in all versions of Darwin
- Thanks to Misty De Meo.
2015-12-31 17:20:22 -05:00
Misty De Meo
3215e3d78e RX: test for presence of REG_ENHANCED
Instead of checking for Darwin, check whether REG_ENHANCED is defined,
since that's the only difference between the two options.

This fixes compiling on older versions of OS X, where REG_ENHANCED is
not defined.
2015-12-31 17:18:08 -05:00
Paul Beckingham
ae47fb7265 TW-1749: PATH_MAX isn't defined in FS.cpp in some versions of OS X
- Thanks to Misty De Meo.
2015-12-31 17:10:35 -05:00
Misty De Meo
be35dde6f0 FS: include sys/syslimits.h on OS X
This fixes an issue where PATH_MAX isn't defined on some versions of
OS X.
2015-12-31 17:06:54 -05:00
Paul Beckingham
641d232dea Copyright: Updated to 2016 2015-12-31 15:06:43 -05:00
Paul Beckingham
f1951f83dc Test: Removed incorrect assumption about 'eow' relative to 'eoy' 2015-12-31 15:04:02 -05:00
Jakub Wilk
5877a54b89 Documentation typo fixes 2015-12-29 20:53:19 -05:00
Paul Beckingham
a5566da07a Docs: Updated NEWS 2015-12-29 11:09:51 -05:00
Tomas Babej
8dcdeeac8b tests: Add test for relative date formatting 2015-12-29 11:03:15 -05:00
Tomas Babej
c25a7ff085 Config: Replace due.remaining with due.relative in defaults 2015-12-29 11:03:11 -05:00
Tomas Babej
cd95282c10 ColTypeDate: Add relative formatter 2015-12-29 11:03:05 -05:00
Paul Beckingham
7d6a7266d3 Config: Removed unused 'dom' configuration settings. 2015-12-27 09:29:37 -05:00
Tomas Babej
510d2e6377 Config: Remove redundant configuration variable shell.prompt 2015-12-26 13:26:08 -05:00
Paul Beckingham
a629b17fec TW-1742: Indian Holiday Calendar (Master HolidayFile)
- Thanks to Sunil Joshi.
2015-12-26 13:18:13 -05:00
Paul Beckingham
a5616fd195 Build: Updated default build instructions 2015-12-26 12:02:43 -05:00
Paul Beckingham
aafb33287d TW-1733: taskwarrior 2.5.0 can not compile FreeBSD 10.1
- Thanks to ribbon.
2015-12-23 08:09:40 -05:00
Paul Beckingham
78047b71a0 TW-1738: add defined languages JAPANESE
- Thanks to ribbon.
2015-12-22 11:42:37 -05:00
Paul Beckingham
22979bb13d Build: Added missing include 2015-12-22 11:07:38 -05:00
Paul Beckingham
7b15ab8c22 List: Refactored listDiff 2015-12-22 08:58:46 -05:00
Paul Beckingham
f12df9cec9 Fish: Removed task.fish arguments until TW-1404 is fixed
- Thanks to Roman Inflianskas
2015-12-20 10:44:24 -05:00
Paul Beckingham
900ad3c26b UDA: indicator column did not properly default to 'U'
- Thanks to JDufault.
2015-12-16 14:57:58 -05:00
Paul Beckingham
c7b792bf47 Build:
- License was not installed.
2015-12-16 14:56:28 -05:00
Paul Beckingham
0344448b3a TW-1729: zsh completion: zregexparse:4: not enough regex argument
- Thanks to Daniel Shahaf.
2015-11-25 07:54:29 -05:00
Paul Beckingham
fc55a5521f Context: Removed parentheses for readability 2015-11-24 07:54:23 -05:00
Paul Beckingham
f92219e5cd CmdInfo: Switched to use indices to make fewer string copies 2015-11-24 07:53:32 -05:00
Daniel Shahaf
5db328f95c TW-1729: zsh completion: Fix edge case with empty database 2015-11-24 07:47:40 -05:00
Daniel Shahaf
ce03d38c7d zsh completion: Remove unused variable. 2015-11-24 07:47:16 -05:00
Wilhelm Schuermann
e5916d0feb JSON: Slightly improve json::encode() performance
More efficient string concatenation combined with a lookup table for
JSON encodings leads to 2% improvement for "export" performance test,
3% improvement for "import" performance test.
2015-11-22 16:09:08 +01:00
Paul Beckingham
d6d867c1cf TW-1658: rc override to non-existent alternate rc quietly uses default
- Thanks to David Patrick.
- The 'rc:' argument now means 'use all defaults', which assumes
  'data.location=~/.task', so this will not work for anyone using a different
  location.
2015-11-18 08:25:49 -05:00
Wilhelm Schuermann
01b5d0a66b Test: Fix mangled "run_all --verbose" output
For lack of being able to reproduce the problem, this is a "fix by
guessing at the root cause" commit.  Don't do this at home.

FreeBSD was showing a 100.04% test suite run because the output of
"test/problems --summary" was intertwined with TAP output.

The only somewhat sane way for this to happen that does not involve
magic is that Python's sys.stdout buffer is not flushed before calling
subprocess.call(), which uses the raw file descriptors.

A quick check of the sources seems to support this theory.
2015-11-17 21:54:14 +01:00
Paul Beckingham
f7d0f500fc TW-1481: Unable to assign a completed task as dependency
- Thanks to Tomas Babej.
2015-11-17 13:56:40 -05:00
Paul Beckingham
253fd35dc7 TW-1425: The 'age' format rounds in odd ways
- While duration formats are still not configurable, the break points for
  formatting units is shifted to be a little more predictable.
- Thanks to Black Ops testing.
2015-11-17 07:47:20 -05:00
Paul Beckingham
ba098d790f TW-1500: Dates formatted as ".age", ".remaining", or ".countdown" often give blank results
- The 'age' column regained the ability to show negative durations.
- The 'countdown' and 'remaining' continue to show only positive values, by
  design.
- Thanks to Jeremy John Reeder.
2015-11-16 07:41:41 -05:00
Paul Beckingham
f71630a416 Themes: 'color.warning' was missing from some themes 2015-11-15 14:45:31 -05:00
Paul Beckingham
67315bf77f Docs: The 'color.warning' setting was not mentioned 2015-11-15 14:44:38 -05:00
Paul Beckingham
9e67ae0132 TW-1724: some commands show color codes when redirected
- Thanks to Alan Young.
2015-11-15 14:43:53 -05:00
Paul Beckingham
a6f8d93fe1 CmdVersion: Color only used for tty 2015-11-15 14:40:37 -05:00
Paul Beckingham
ec779bb0e8 CmdTimesheet: Color only used for tty 2015-11-15 14:39:08 -05:00
Paul Beckingham
271e28f609 CmdSync: Color only used for tty 2015-11-15 14:35:28 -05:00
Paul Beckingham
d8124d1aad CmdHistory: Color only used for tty 2015-11-15 14:31:55 -05:00
Paul Beckingham
116e5adaf2 CmdContext: Color only used for tty 2015-11-15 14:29:09 -05:00
Paul Beckingham
30a2ab8ea8 CmdShow: Color only used for tty 2015-11-15 14:24:31 -05:00
Paul Beckingham
c4f7e1a869 CmdTags: Color only used for tty 2015-11-15 14:22:18 -05:00
Paul Beckingham
9442df8342 CmdSummary: Color only used for tty 2015-11-15 14:21:55 -05:00
Paul Beckingham
802ff9df05 CmdUDAs: Color only used for tty 2015-11-15 14:21:38 -05:00
Paul Beckingham
7dc035d9ff CmdProjects: Color only used for tty 2015-11-15 14:20:43 -05:00
Paul Beckingham
9e2c6f8d47 CmdReports: Color only used for tty 2015-11-15 14:20:17 -05:00
Paul Beckingham
a863abf2b0 CmdStats: Color only used for tty 2015-11-15 14:19:12 -05:00
Paul Beckingham
79189c448c TW-1723: task info causes segfault
- Thanks to Roman Golovin.
- Calls like 'context.columns[name]' autovivify the key 'name' with a default
  ctor value, which ends up polluting the context.columns map with every unique
  attribute name, which is a lot of 'annotation_nnnnnnnnnn' attributes.
2015-11-15 12:57:26 -05:00
Wilhelm Schuermann
fdda485032 Test: Fix clerical error
240 - 6 != 236
2015-11-12 17:52:53 +01:00
Wilhelm Schuermann
77283241a9 Nibbler: Improve getQuoted() performance
Improves "load" time for all performance tests that load data by ~20%.
 - "next"   down 15% total
 - "list"   down  7% total
 - "all"    down  3% total
 - "add"    down 15% total
 - "export" down  8% total
 - "import" down  6% total
2015-11-12 16:24:22 +01:00
Wilhelm Schuermann
96ca7eb5f2 Nibbler: Remove unused function argument 2015-11-12 13:36:23 +01:00
Wilhelm Schuermann
0961a011f4 Test: Make sorting.t test timing independent 2015-11-11 09:51:31 +01:00
Wilhelm Schuermann
ad81810fd3 FS: Fix performance on high latency systems
fseek() in File::append() was invalidating the file buffer for each call
to append().  Better handling improves "import" performance test by 9%,
45% in "commit", on a system with a spinning disk.

This performance problem affects all operations where
{pending,completed}.data are rewritten.  During normal operation a
garbage collection can be enough to trigger it.  On storage with high
latency, e.g. networked, this previously took 20 seconds and more.
2015-11-11 08:48:51 +01:00
Paul Beckingham
e6f142be17 ISO8601: Moved ::parse_epoch to occur first 2015-11-10 17:41:12 -05:00
Wilhelm Schuermann
4424c5e450 TDB2: Further gc() cleanup 2015-11-10 17:10:03 +01:00
Wilhelm Schuermann
ca9cd46f1c TW-1582: Wrong urgency for first report after reviving task
Fixed as a by-product of 6dc30a9a1a
2015-11-10 16:48:17 +01:00
Wilhelm Schuermann
5ac1b1c6dd TDB2: Remove unnecessary code
- ID assignment is now handled in TF2::load_task(), the removed code
  duplicated that effort.  Barely noticeable performance impact.
2015-11-10 16:39:37 +01:00
Wilhelm Schuermann
6dc30a9a1a TDB2: Move gc() processing to TF2::load_tasks()
Reduce the amount of copies necessary for TDB2::gc() by moving the GC
processing to the Task object source - TF2::load_tasks().

This entangles TDB2 and TF2 more than previously, but leads to huge
performance benefits:
 - "next"   performance test down 21%
 - "list"   performance test down 11%
 - "all"    performance test down  4%
 - "export" performance test down  9%

The "gc" measurement is down 96% for all performance tests.  This is a
result of moving the actual processing into TF2::load_gc() and not
measuring the time taken by that function as "gc" time.
2015-11-09 19:20:57 +01:00
Paul Beckingham
7b8df7a439 Test: Conditional compilation allows Taskserver to reuse code 2015-11-08 17:05:30 -05:00
Paul Beckingham
f15e93ccc8 Test: Updated template with more resilient test from Taskserver 2015-11-08 17:04:45 -05:00
Paul Beckingham
1407e0410e TLSClient: Added more diagnostics in debug mode 2015-11-08 17:03:35 -05:00
Paul Beckingham
9415f62482 Task: Conditional compilation allows Taskserver to reuse code 2015-11-08 17:03:05 -05:00
Paul Beckingham
0141d10d56 ISO8601: Conditional compilation allows Taskserver to reuse code 2015-11-08 17:02:02 -05:00
Paul Beckingham
560bf53f42 Performance: Script now allows overrides, for comparison 2015-11-07 20:27:09 -05:00
Paul Beckingham
53431da5d9 Docs: Updated ChangeLog 2015-11-07 17:46:40 -05:00
Daniel Shahaf
823e3d51d0 Test: Make 'make test' exit non-zero if tests failed 2015-11-07 17:45:55 -05:00
Paul Beckingham
8e778712ea TW-1313: some recurring intervals reset due time to midnight
- Thanks to James Dietrich.
2015-11-07 17:12:25 -05:00
Paul Beckingham
072acdbb18 TW-1446: Difference in how relative dates are specified in report filters since 2.3.0
- Thanks to atomicules.
2015-11-07 16:50:23 -05:00
Paul Beckingham
d506e19d93 TW-38: Dates in the far future give bad estimates in burndown
- Thanks to Ben Boeckel.
2015-11-07 15:56:36 -05:00
Paul Beckingham
743baf00cf TW-311: Estimated completion in burndown.daily shows impossible results
- Thanks to Michele Santullo.
- Although TW-311 references impossible results, there are two problems.
  First there is the algorithm that determines estimateѕ completion, and
  second there is the reference to wait dates. The algorithm has been replaced
  by something better, but wait dates have nothing to do with estimation.
- The 'burndown.bias' configuration setting is removed.
- The estimated completion is based on the net completion rate since the
  high water mark of total pending tasks, measured on a daily basis, regardless
  of the type of chart produced.
- Vim syntax updated.
- Docs updated.
2015-11-07 15:35:21 -05:00
Paul Beckingham
0b3d38b0e6 FS: Removed unnecessary include 2015-11-06 18:22:45 -05:00
Paul Beckingham
940c7a793f Portability: Fixed broken build for Cygwin and older GCC
- Thanks to Richard Boß.
2015-11-06 18:22:05 -05:00
Wilhelm Schuermann
8f8ad813cd Task: Remove std::map inheritance, clean up interface
- Make the Task object's interface more explicit by removing the
  std::map inheritance.
- Using this more explicit interface, remove unneeded ctors in order to
  allow the compiler to "Do The Right Thing"(tm).
  This leads to a performance improvement of 12% in the "add"
  performance test, and 7% for "import".
2015-11-04 20:33:52 +01:00
Paul Beckingham
c248a32cab Task: Removed unnecessary 'this->' 2015-11-04 07:00:52 -05:00
Wilhelm Schuermann
41843d77b0 TDB2: Use efficient data structures for lookup
- Leads to 1-3% improvement across all performance tests.
- _I2U could very likely be further optimized by using a sparse vector,
  or handling the edge cases of this approach ourselves.
2015-11-04 07:52:19 +01:00
Wilhelm Schuermann
80b5a584b7 Task: Reduce temporaries in composeFF4()
- Reducing temporaries leads to 3% performance increase in "import"
  performance test - 6% in "commit", 2% in "other".
2015-11-03 21:35:47 +01:00
Paul Beckingham
a2bd6d8342 Revert "Variant: Converted from sprintf to std::to_string"
This reverts commit f339672b89.
2015-11-02 18:46:36 -05:00
Paul Beckingham
2c0bb1663d Revert "Recurrence: Converted from sprintf to std::to_string"
This reverts commit b4035d6ff5.
2015-11-02 18:46:19 -05:00
Paul Beckingham
def0223afa Revert "Task: Converted to use to_string where appropriate"
This reverts commit 136f849aa8.
2015-11-02 18:45:55 -05:00
Paul Beckingham
13b6bf3312 Revert "Docs: Added gcc requirement for Cygwin"
This reverts commit abc988476d.
2015-11-02 18:44:48 -05:00
Paul Beckingham
b4b41215a2 Revert "C++11: Migrated from strtod to std::stod"
This reverts commit db49efd72f.
2015-11-02 18:44:29 -05:00
Paul Beckingham
ee40f89804 Revert "C++11: Converted from strtoimax to std::stoi"
This reverts commit 36ad7ead41.
2015-11-02 18:42:35 -05:00
Paul Beckingham
5a01fe003d Revert "Col*: Missing paren"
This reverts commit e3ea548de0.
2015-11-02 18:42:16 -05:00
Paul Beckingham
d23d0fafb7 Revert "TDB2: Converted from strtoul to std::stoul"
This reverts commit bdfd22ad88.
2015-11-02 18:41:57 -05:00
Paul Beckingham
ef3e072436 Revert "Variant: Converted from strtol/substr to std::stoi/std::compare"
This reverts commit 6df55c9156.
2015-11-02 18:41:44 -05:00
Paul Beckingham
3169490219 Revert "Context: Converted from strtol to std::stoi"
This reverts commit 8e214d1b14.
2015-11-02 18:41:33 -05:00
Paul Beckingham
a3736f6363 Revert "Dates: Converted from strtol to std::stoi"
This reverts commit d295755bb7.
2015-11-02 18:41:22 -05:00
Paul Beckingham
7d4ccb652e Revert "DOM: Concerted from strtol to std::stoul/stoi"
This reverts commit c903185481.
2015-11-02 18:41:08 -05:00
Paul Beckingham
204c95993b Revert "CLI2: Converted from strtol to std::stoi"
This reverts commit 91afa9b567.
2015-11-02 18:40:49 -05:00
Paul Beckingham
1bdede371e Revert "ISO8601: Converted from strtol to std::stoi/stoul"
This reverts commit 8205fd2446.
2015-11-02 18:40:34 -05:00
Paul Beckingham
261b062369 Revert "Task: Converted from strto* to std::sto*"
This reverts commit d9cf0fb923.
2015-11-02 18:40:20 -05:00
Paul Beckingham
9a33aa2997 Revert "sort: Converted from strtof to std::stof"
This reverts commit 8db04b8ec1.
2015-11-02 18:40:06 -05:00
Paul Beckingham
993b94c701 Revert "Recurrence: Converted from strtol to std::stoi"
This reverts commit 368df43583.
2015-11-02 18:39:55 -05:00
Paul Beckingham
5f1edbfce1 Revert "CmdEdit: Converted from strtol to std::stoi/stoul"
This reverts commit cf831a9b7c.
2015-11-02 18:39:41 -05:00
Paul Beckingham
639e04d853 Revert "CmdCalendar: Converted from strtol to std::stoul/stoi"
This reverts commit 3745f83a7b.
2015-11-02 18:39:29 -05:00
Paul Beckingham
665863809d Revert "CmdInfo: Converted from strtol to std::stoul"
This reverts commit 037514bcbf.
2015-11-02 18:39:12 -05:00
Paul Beckingham
03d564dd78 Revert "CmdStats: Converted from strtol to std::stoul"
This reverts commit 2b8ce968fc.
2015-11-02 18:38:59 -05:00
Paul Beckingham
49ad7c2ce2 Revert "CmdSummary: Converted from strtol to std::stoul"
This reverts commit 0d88df1c18.
2015-11-02 18:38:44 -05:00
Paul Beckingham
de43e34c5e Revert "CmdTimesheet: Converted from strtol to std::stoi"
This reverts commit 02f1fa371c.
2015-11-02 18:38:31 -05:00
Paul Beckingham
d4f6f00b29 Revert "Feedback: Converted from strtol to std::stoul"
This reverts commit 8f60b1f9c5.
2015-11-02 18:38:21 -05:00
Paul Beckingham
284330ea1d Nibbler: Reverted std::stoi change 2015-11-02 18:37:50 -05:00
Paul Beckingham
508559f766 Revert "DOM: Converted from strtol to std::stoi"
This reverts commit 7c5055de7a.
2015-11-02 18:36:19 -05:00
Paul Beckingham
f64cbe1e81 Column: A std::map was being used as a std::set 2015-11-02 08:13:32 -05:00
Paul Beckingham
1d1be49bbd ColUDA: No point using utf8_width on non-UTF8 data 2015-11-02 08:13:00 -05:00
Paul Beckingham
3ab2410df3 Task: Conditional JSON/Task encoding, based on attribute type 2015-11-02 07:54:13 -05:00
Wilhelm Schuermann
de4be46cab ColParent: Adjust comment 2015-11-02 08:27:11 +01:00
Wilhelm Schuermann
3e8cb20284 Color: Improve colorize() performance
- Improves "render" time by ~45-55% across relevant performance tests.
- Improves "list" performance test by ~20%.
- Improves "all" performance test by ~40%.
2015-11-02 06:59:18 +01:00
Paul Beckingham
5b2328cd6c legacy: Now uses static initialization 2015-11-01 23:03:38 -05:00
Paul Beckingham
7c5055de7a DOM: Converted from strtol to std::stoi 2015-11-01 22:55:14 -05:00
Paul Beckingham
7158942d03 Nibbler: Converted from strtof to std::stod 2015-11-01 22:10:13 -05:00
Paul Beckingham
8f60b1f9c5 Feedback: Converted from strtol to std::stoul 2015-11-01 22:09:01 -05:00
Paul Beckingham
02f1fa371c CmdTimesheet: Converted from strtol to std::stoi 2015-11-01 22:08:24 -05:00
Paul Beckingham
0d88df1c18 CmdSummary: Converted from strtol to std::stoul 2015-11-01 22:07:46 -05:00
Paul Beckingham
2b8ce968fc CmdStats: Converted from strtol to std::stoul 2015-11-01 22:06:28 -05:00
Paul Beckingham
037514bcbf CmdInfo: Converted from strtol to std::stoul 2015-11-01 22:05:46 -05:00
Paul Beckingham
3745f83a7b CmdCalendar: Converted from strtol to std::stoul/stoi 2015-11-01 22:05:11 -05:00
Paul Beckingham
cf831a9b7c CmdEdit: Converted from strtol to std::stoi/stoul 2015-11-01 22:00:44 -05:00
Paul Beckingham
368df43583 Recurrence: Converted from strtol to std::stoi 2015-11-01 21:54:29 -05:00
Paul Beckingham
8db04b8ec1 sort: Converted from strtof to std::stof 2015-11-01 21:53:07 -05:00
Paul Beckingham
d9cf0fb923 Task: Converted from strto* to std::sto* 2015-11-01 21:49:34 -05:00
Paul Beckingham
8205fd2446 ISO8601: Converted from strtol to std::stoi/stoul 2015-11-01 21:46:32 -05:00
Paul Beckingham
91afa9b567 CLI2: Converted from strtol to std::stoi 2015-11-01 21:44:08 -05:00
Paul Beckingham
c903185481 DOM: Concerted from strtol to std::stoul/stoi 2015-11-01 21:42:53 -05:00
Paul Beckingham
d295755bb7 Dates: Converted from strtol to std::stoi 2015-11-01 21:41:47 -05:00
Paul Beckingham
8e214d1b14 Context: Converted from strtol to std::stoi 2015-11-01 21:39:19 -05:00
Paul Beckingham
6df55c9156 Variant: Converted from strtol/substr to std::stoi/std::compare 2015-11-01 21:33:07 -05:00
Paul Beckingham
bdfd22ad88 TDB2: Converted from strtoul to std::stoul 2015-11-01 21:31:10 -05:00
Paul Beckingham
e3ea548de0 Col*: Missing paren 2015-11-01 20:12:47 -05:00
Paul Beckingham
36ad7ead41 C++11: Converted from strtoimax to std::stoi 2015-11-01 20:03:51 -05:00
Paul Beckingham
5c8b7148b4 Task: Moved include to top of list, per flint++ recommendation 2015-11-01 19:59:10 -05:00
Paul Beckingham
5d9ca9864e Cmd*: Moved include to top of list, per flint++ recommendation 2015-11-01 19:53:19 -05:00
Paul Beckingham
aceebb0723 Col*: Moved include to top of list, per flint++ recommendation 2015-11-01 19:47:20 -05:00
Paul Beckingham
db49efd72f C++11: Migrated from strtod to std::stod 2015-11-01 19:44:15 -05:00
Paul Beckingham
abc988476d Docs: Added gcc requirement for Cygwin 2015-11-01 19:34:24 -05:00
Paul Beckingham
ee9d303b10 Task: Removed unnecessary chomp in ::parse 2015-11-01 19:14:41 -05:00
Paul Beckingham
2aa3163451 Task: Use one-step attribute erase 2015-11-01 19:03:04 -05:00
Paul Beckingham
136f849aa8 Task: Converted to use to_string where appropriate 2015-11-01 18:56:50 -05:00
Paul Beckingham
b4035d6ff5 Recurrence: Converted from sprintf to std::to_string 2015-11-01 18:49:11 -05:00
Paul Beckingham
f339672b89 Variant: Converted from sprintf to std::to_string 2015-11-01 18:36:37 -05:00
Paul Beckingham
d1a6fecde3 ISO8601: Converted ::toString from sprintf for std::stringstream 2015-11-01 18:02:55 -05:00
Paul Beckingham
7a48d25eaa ISO8601: Implemented ::dayNameShort and ::monthNameShort
- Added tests.
2015-11-01 18:02:08 -05:00
Paul Beckingham
9143d8b8e7 ISO8601: Covnerted from sprintf to std::stringstream 2015-11-01 17:20:48 -05:00
Paul Beckingham
d8c5927362 ISO8601: Removed cowardly segfault fix 2015-11-01 17:04:08 -05:00
Paul Beckingham
78b8fc5dc7 Column: Phasing out text.cpp/nontrivial() 2015-11-01 16:48:34 -05:00
Paul Beckingham
b5c4bf0a6d Performance: Removed unnecessary std::string::substr in high-traffic code 2015-11-01 16:10:49 -05:00
Paul Beckingham
25b7f42810 CmdExport: Simplified looping with 'auto' 2015-11-01 13:50:45 -05:00
Paul Beckingham
20493ec7d8 ColTypeDuration: Added missing type 2015-10-31 17:08:35 -04:00
Paul Beckingham
46db62ff00 ColTypeDate: Now uses ::renderString{Left,Right} 2015-10-31 16:56:58 -04:00
Paul Beckingham
ce507c0011 ColUDA: Now uses ::renderString{Left,Right} 2015-10-31 16:56:25 -04:00
Paul Beckingham
cd70d56260 ColString: Now uses ::renderString{Left,Right} 2015-10-31 16:55:55 -04:00
Paul Beckingham
410175efd3 ColStart: Now uses ::renderStringRight 2015-10-31 16:55:32 -04:00
Paul Beckingham
5c9f1f7b45 ColRecue: Now uses ::renderStringRight 2015-10-31 16:55:00 -04:00
Paul Beckingham
99f6e6d634 ColProject: Now uses ::renderStringLeft 2015-10-31 16:54:44 -04:00
Paul Beckingham
281366e38b ColMask: Now uses ::renderStringRight 2015-10-31 16:54:21 -04:00
Paul Beckingham
87a35d4dec ColID: Now uses ::renderStringRight 2015-10-31 16:53:50 -04:00
Paul Beckingham
3d832a0d5a ColDescription: Now uses ::renderStringLeft 2015-10-31 16:15:47 -04:00
Paul Beckingham
83fa5a6e55 ColStatus: Now uses ::renderStringLeft 2015-10-31 16:15:24 -04:00
Paul Beckingham
43cdb0fa3a ColTags: Now uses ::renderStringRight 2015-10-31 16:15:05 -04:00
Paul Beckingham
4411fc02c5 ColMask: Now uses ::renderStringLeft 2015-10-31 16:14:44 -04:00
Paul Beckingham
292e2f1b89 ColDepends: Now uses ::renderStringLeft 2015-10-31 16:14:14 -04:00
Paul Beckingham
06c50efa63 ColUUID: Now uses ::renderStringLeft 2015-10-31 15:54:35 -04:00
Paul Beckingham
65b8fb7bce ColParent: Fixed short form truncation
- The short form now takes the first 8 characters, not the last.
  No one noticed.
2015-10-31 15:53:15 -04:00
Paul Beckingham
668fd2301e ColParent: Now uses ::renderStringLeft 2015-10-31 15:44:05 -04:00
Paul Beckingham
04c3e9e537 Column: Implemented ::renderStringLeft, ::renderStringRight 2015-10-31 15:42:32 -04:00
Paul Beckingham
43e4f8a485 ColUrgency: Now uses Column::render{Integer,Double} 2015-10-31 15:24:03 -04:00
Paul Beckingham
4c55b8c9af ColID: Uses Column::renderInteger 2015-10-31 15:23:04 -04:00
Paul Beckingham
4837e9aa9d ColTypeNumeric: Delegated type to base class 2015-10-31 15:22:25 -04:00
Paul Beckingham
9ea69ea802 Column: Explained justification 2015-10-31 15:20:35 -04:00
Paul Beckingham
4d42584ca0 Column: Implemented ::renderDouble 2015-10-31 15:19:19 -04:00
Paul Beckingham
b8ae54275e Column: Implemented ::renderInteger 2015-10-31 15:16:51 -04:00
Paul Beckingham
dc72a22887 Col*: Moving code into ColTypeString base 2015-10-31 14:35:06 -04:00
Paul Beckingham
de9c0b97f6 Col*: Assigned a type-specific base class to each column object
- Base class currently does nothing.
2015-10-31 12:12:30 -04:00
Paul Beckingham
3475995f39 ColType*: Added Duration, String and Numeric type base classes 2015-10-31 11:54:53 -04:00
Paul Beckingham
2a6ce539d0 ColTypeDate: Renamed 'ColDate' to 'ColTypeDate'
- Renamed files ColDate* to ColTypeDate*.
- Renamed objects ColumnDate* to ColumnTypeDate*.
- This is mainly to make way for ColType{Duration,String,Numeric}, while leaving
  ColString untouched. ColString is used only for ViewText columns, but may soon
  be replaced by ColTypeString. Unknown.
2015-10-31 11:35:24 -04:00
Paul Beckingham
6baff92b5a Column: Removed ::can_modify, which is moot 2015-10-31 11:14:23 -04:00
Tomas Babej
2ff8d8329f TW-1720: CmdContext uses a mix of both throw and std::cout to convey errors 2015-10-30 16:40:13 -04:00
Tomas Babej
8505d8a42c tests: Make sure correct output stream is expected in CmdContext tests 2015-10-30 16:33:31 -04:00
Tomas Babej
98973a9390 CmdContext: Handle errors in a consistent way 2015-10-30 16:33:16 -04:00
Paul Beckingham
ba23b926dd Lexer: Missing include 2015-10-30 12:44:00 -04:00
Paul Beckingham
2f23406087 Perf: Removed Python3 requirement, which is not needed 2015-10-30 12:39:03 -04:00
Paul Beckingham
b4fc2b5583 JSON: Added std::string::reserve to compensate for growth 2015-10-30 12:38:08 -04:00
Paul Beckingham
6ce3285c77 Lexer: Modified ::trim to make one less copy 2015-10-30 11:41:16 -04:00
Paul Beckingham
182b5427cd Lexer: Migrated trim(), trimLeft() and trimRight() from text to Lexer 2015-10-30 11:17:23 -04:00
Paul Beckingham
51def4b12b Lexer: Migrated commify, ucFirst and lowerCase from text to Lexer 2015-10-30 10:57:14 -04:00
Wilhelm Schuermann
7119c42780 Performance: Crude comparison script bugfix
- Compare timings as integer values, not strings.
2015-10-30 09:34:40 +01:00
Paul Beckingham
112621ef13 CmdIDs: _zshuuids no longer obeys context 2015-10-30 00:51:37 -04:00
Paul Beckingham
4d9ac995fe CmdUrgency: _urgency no longer obeys context 2015-10-30 00:50:49 -04:00
Paul Beckingham
54ca77bfab Variant: Uses ISO8601{d,p} instead of duplicating formatting 2015-10-30 00:39:53 -04:00
Paul Beckingham
61fc32d04f ISO8601: Added ::toISOLocalExtended method 2015-10-30 00:38:49 -04:00
Paul Beckingham
1cb295ef67 Task: Removed legacy encodings
- &dquot; -> \"
- &quot;  -> '
- &squot; -> '
- &comma; -> ,
- &colon; -> :
2015-10-30 00:12:52 -04:00
Paul Beckingham
dd82835ac4 Nibbler: Removed unused ::backN method 2015-10-29 23:55:43 -04:00
Paul Beckingham
297f2b6e99 Nibbler: Removed unused ::skipAll method 2015-10-29 23:53:17 -04:00
Paul Beckingham
119827e4e1 Nibbler: Removed unused ::getDigit6 method 2015-10-29 23:46:48 -04:00
Paul Beckingham
88469fc5f9 Nibbler: Removed unused ::getUntilEOL method 2015-10-29 23:41:01 -04:00
Paul Beckingham
0c5984c517 Nibbler: Removed unused ::getWord method 2015-10-29 23:34:46 -04:00
Paul Beckingham
78da4ffb90 Nibbler: Removed unused ::getName method 2015-10-29 23:32:07 -04:00
Paul Beckingham
38b9e54955 Nibbler: Removed unused ::getUUID method 2015-10-29 23:28:42 -04:00
Paul Beckingham
4098e54238 Nibbler: Removed duplicate includes 2015-10-29 23:26:05 -04:00
Paul Beckingham
1e8eac0e3d Nibbler: Removed unused ::getRx method 2015-10-29 23:23:41 -04:00
Paul Beckingham
de66200028 Nibbler: Removed unused ::getUntilRx method 2015-10-29 23:19:41 -04:00
Paul Beckingham
180d3e75ff Nibbler: Removed unused ::skipRx method 2015-10-29 23:19:01 -04:00
Paul Beckingham
ad26d98d0f UTF8: Cleanup 2015-10-29 23:14:46 -04:00
Tomas Babej
de8c7d230f CmdDiagnostics: Add broken reference detection 2015-10-29 20:52:00 -04:00
Tomas Babej
0693f3cfc4 CmdDiagnostics: Remove redundant nesting 2015-10-29 20:51:57 -04:00
Tomas Babej
22368b9a40 Revive TDB2::has and TF2::has methods
This reverts commit fa920f02aa. Methods
found their usage after all.
2015-10-29 20:51:45 -04:00
Tomas Babej
2d25cf6f59 TW-1704: Task: Use Task::identifier to reference the task
To achieve consistent output, use a helper method to generate a proper
handle - ID for tasks with non-zero ID, UUID otherwise.
2015-10-29 20:00:53 -04:00
Paul Beckingham
1236abc7d5 CmdColumns: Now shows whether a column is modifiable or read only 2015-10-29 14:14:07 -04:00
Paul Beckingham
3749378867 Documentation: Updated NEWS and ChangeLog 2015-10-29 12:22:39 -04:00
Paul Beckingham
ccbb71bab4 Config: Eliminated 16-color default on non-Linux, non-Darwin platforms 2015-10-29 09:31:07 -04:00
Paul Beckingham
7693245c1d Nibbler: Removed unused ::parseDigits method 2015-10-28 22:08:50 -04:00
Paul Beckingham
e41282122d Test: Added Lexer::typeName tests 2015-10-28 22:05:20 -04:00
Paul Beckingham
18b810b033 Test: Added test for debug.hooks output 2015-10-28 21:55:25 -04:00
Paul Beckingham
5cfa4454ed Test: Added test for missing date synonyms 2015-10-28 21:47:19 -04:00
Paul Beckingham
923991df1b Config: Removed unused ctor 2015-10-28 21:32:33 -04:00
Paul Beckingham
b7bbd96b62 Eval: Removed unused ::compileExpression override 2015-10-28 20:54:03 -04:00
Paul Beckingham
64bf571c13 List: Removed unused listDiff and liѕtIntersect templates and tests 2015-10-28 20:51:31 -04:00
Paul Beckingham
af49564194 FS: Removed unused ::write and ::append methods 2015-10-28 20:38:41 -04:00
Paul Beckingham
c64c6ee870 Filter: Removed unused ::hasModifications and ::hasMiscellaneous methods 2015-10-28 20:23:32 -04:00
Paul Beckingham
741afd2240 Nibbler: Removed unused ::getDateISO method 2015-10-28 20:13:55 -04:00
Paul Beckingham
51afff2e6e Nibbler: Removed unused ::getDate and tests 2015-10-28 20:09:55 -04:00
Paul Beckingham
a369d1ed2d Test: Added colored obfuscation tests 2015-10-28 19:54:57 -04:00
Paul Beckingham
e833cf05c5 Test: Added more dateformat parse tests 2015-10-28 19:48:12 -04:00
Paul Beckingham
7d58ddff6b CmdSummary: Removed unreachable code 2015-10-28 18:41:55 -04:00
Paul Beckingham
5cad0a0d4e Test: Added summary report error handling tests 2015-10-28 18:38:57 -04:00
Paul Beckingham
52f13a97a7 Test: Added prepend test with no filter, no text 2015-10-28 18:35:36 -04:00
Paul Beckingham
9cbbf2b71c Test: Added no-color logo test 2015-10-28 18:32:54 -04:00
Paul Beckingham
7fb907c76c Test: Added relevant urgency coefficients for info test 2015-10-28 18:30:52 -04:00
Paul Beckingham
c8cba22a3d Test: Added bad filter info test 2015-10-28 18:28:03 -04:00
Paul Beckingham
778ba44beb CmdImport: Removed redundant filter processing 2015-10-28 18:21:59 -04:00
Paul Beckingham
e76f63aa01 Test: Added UDA orphan to edit test 2015-10-28 18:17:59 -04:00
Paul Beckingham
512dcf5d48 Test: Added UDAs to edit test 2015-10-28 18:15:54 -04:00
Paul Beckingham
cf329ab3f5 Test: Added different UDA types to info test 2015-10-28 17:59:50 -04:00
Paul Beckingham
dbabcdfed4 Test: Added non-color ghistory chart tests. 2015-10-28 17:54:51 -04:00
Paul Beckingham
65347b7a21 Test: Added test for 'color.alternate' in custom reports 2015-10-28 17:46:08 -04:00
Paul Beckingham
cebece6d23 Test: Added error handling test for column/label mismatch 2015-10-28 17:45:48 -04:00
Paul Beckingham
34d5a07d90 Test: Added context tests
- Added 'input="y\n"' to a test that was otherwise timing out.
- Added multi-word context test.
2015-10-28 17:37:08 -04:00
Paul Beckingham
acb83130fa Test: Added calendar test wiht full details and color 2015-10-28 17:29:27 -04:00
Paul Beckingham
0250145895 Test: Addd calendar 'rc.calendar.offset' test 2015-10-28 17:27:46 -04:00
Paul Beckingham
2d5c88994a Test: Added calendar tests for 'january', 'jan'. 2015-10-28 17:25:26 -04:00
Paul Beckingham
5a0a28e39b Test: Added converging burndown data 2015-10-28 17:19:58 -04:00
Paul Beckingham
f3503923c0 Test: Added burndown chart test in color 2015-10-28 17:16:28 -04:00
Paul Beckingham
958637e2ca CmdBurndown: Removed unreachable code (completed/deleted tasks have no 'start' date) 2015-10-28 17:06:47 -04:00
Paul Beckingham
258328facd Test: Verify 'columns rc._forcecolor:on' works 2015-10-28 16:46:20 -04:00
Paul Beckingham
6bb9cd49ea Test: Tested color output of commands 2015-10-28 16:44:39 -04:00
Paul Beckingham
bb807776cf Test: Added tests to verify context error handling 2015-10-28 16:40:14 -04:00
Paul Beckingham
ef0b221b0f Test: Added 'sort:none' test 2015-10-28 16:06:01 -04:00
Paul Beckingham
9a0220f3d4 Test: Fixed 'edit' test that used 'active', but meant 'start' 2015-10-28 15:14:32 -04:00
Paul Beckingham
8b2eac62ba Test: Added test for hook details in 'diagnostics' command. 2015-10-28 14:58:45 -04:00
Paul Beckingham
e96ef5e729 Test: Added calendar tests with various options enabled 2015-10-28 14:55:31 -04:00
Paul Beckingham
4b1bdf4423 Test: Added test to make sure 'ids' compresses consecutive IDs into a range 2015-10-28 14:30:05 -04:00
Paul Beckingham
c6826a86bb Test: Added (back) logo.t test for coverage 2015-10-28 14:26:11 -04:00
Paul Beckingham
16db5de994 Test: Added color 'reports' test for coverage 2015-10-28 14:23:22 -04:00
Paul Beckingham
df3bcb1a4d Test: Added color to 'stats' test, for coverage 2015-10-28 14:20:57 -04:00
Paul Beckingham
cb2eadcb2f Test: Added due dates to timesheet tests, for coverage 2015-10-28 14:17:02 -04:00
Paul Beckingham
611cf69c99 Test: Added test for orphans listed in 'udas' output 2015-10-28 14:12:12 -04:00
Paul Beckingham
18c19ab9ed Framework: Added 'del_config' method to delete a config entry 2015-10-28 14:09:44 -04:00
Paul Beckingham
aabd179ffc Test: Added '_unique id' test 2015-10-28 13:58:21 -04:00
Paul Beckingham
ab025b27ff Test: Added UUID urgency test 2015-10-28 13:55:37 -04:00
Paul Beckingham
735608d5b9 Context: Removed unused ::clearMessages method 2015-10-28 13:23:38 -04:00
Paul Beckingham
2cececd205 Color: Removed unused ctor 2015-10-28 13:19:23 -04:00
Paul Beckingham
9b59eefbc3 Test: Added ISO8601d formatting tests 2015-10-28 13:13:09 -04:00
Paul Beckingham
57daa02232 Test: Improved undo tests with more changes 2015-10-28 12:51:24 -04:00
Paul Beckingham
849835ed24 Test: Added command DNA test 2015-10-28 12:24:22 -04:00
Paul Beckingham
fa920f02aa TDB2: Removed unused ::has methods 2015-10-28 12:16:46 -04:00
Paul Beckingham
e3ad04aa37 Test: Added tests for rc.undo.style formatting 2015-10-28 12:13:42 -04:00
Paul Beckingham
b33e26f24d Test: Added more test methods to template.t 2015-10-28 12:05:48 -04:00
Paul Beckingham
6570a42eee ISO8601: Removed unused methods 2015-10-28 11:47:28 -04:00
Paul Beckingham
78b4e4fcc8 Test: Added test for +nonag 2015-10-28 11:30:51 -04:00
Paul Beckingham
ec027b707d Test: Added Directory::cd test 2015-10-28 11:17:26 -04:00
Paul Beckingham
67c28b7015 FS: Removed unused ::read method 2015-10-28 11:09:38 -04:00
Paul Beckingham
411c735d4e FS: Removed unused ::openAndLock method 2015-10-28 11:06:38 -04:00
Paul Beckingham
342624f272 FS: Removed unused ostream operator<< 2015-10-28 11:02:29 -04:00
Paul Beckingham
8b1a21d206 Test: Added test of Path expanѕion of '~' 2015-10-28 11:01:34 -04:00
Paul Beckingham
c7f3371429 Test: Added tests for dependency formats 2015-10-28 10:56:32 -04:00
Wilhelm Schuermann
759b30a9ac Performance: Add crude comparison script 2015-10-26 15:19:52 +01:00
Wilhelm Schuermann
2d28ac19a7 TW-1718: Test for "String UDA not passed through unchanged" 2015-10-26 09:50:54 +01:00
Paul Beckingham
b8a05f10d4 Test: Merged tw-1687.t into abbreviation.t 2015-10-25 11:55:55 -04:00
Paul Beckingham
5859b2d54a Test: Merged tw-1634.t into filter.t 2015-10-25 11:54:16 -04:00
Paul Beckingham
362d3f7c4a Test: Merged tw-1630.t into filter.t 2015-10-25 11:52:35 -04:00
Paul Beckingham
df75e549a1 Test: Merged tw-1627.t into project.t 2015-10-25 11:50:53 -04:00
Paul Beckingham
01526e298c Test: Merged tw‐1622.t into uda.t 2015-10-25 11:50:01 -04:00
Paul Beckingham
4c95ba86bb Test: Merged tw-1620.t into dateformat.t 2015-10-25 11:48:48 -04:00
Paul Beckingham
9df8187396 Test: Merged tw-1617.t into project.t 2015-10-25 11:47:14 -04:00
Paul Beckingham
8d45d40a90 Test: Merged tw-1612.t into add.t 2015-10-25 11:44:59 -04:00
Paul Beckingham
b025f0524b Test: Merged tw-1609.t into filter.t 2015-10-25 11:43:48 -04:00
Paul Beckingham
cf923b23c8 Test: Merged tw-1575.t into log.t 2015-10-25 11:41:38 -04:00
Paul Beckingham
e369ee796d Test: Merged tw-1549.t into add.t 2015-10-25 11:39:41 -04:00
Paul Beckingham
484c8cc367 Test: Merged tw-1542.t into uda.t 2015-10-25 11:37:52 -04:00
Paul Beckingham
58fe2326db Test: Merged tw-1527.t into add.t 2015-10-25 11:36:39 -04:00
Paul Beckingham
e857804ccc Test: Merged tw-1521.t into filter.t 2015-10-25 11:35:26 -04:00
Paul Beckingham
c6b5576194 Docs: Updated README 2015-10-25 11:34:12 -04:00
Paul Beckingham
cb381bf388 Test: Renamed tw-1510.t to backlog.t 2015-10-25 11:24:55 -04:00
Paul Beckingham
1544d180a9 Test: Merged tw-1486.t into wait.t 2015-10-25 11:16:35 -04:00
Paul Beckingham
197e569d08 Test: Merged tw-1481.t into dependencies.t 2015-10-25 11:14:11 -04:00
Paul Beckingham
a81040e7e9 Test: Merged tw-1479.t into search.t 2015-10-25 10:53:51 -04:00
Paul Beckingham
7ac8bfe737 Test: Merged tw-1475.t into configuration.t 2015-10-25 10:44:04 -04:00
Paul Beckingham
f6f1fe0f02 Test: Merged tw-1469.t into search.t 2015-10-25 10:40:19 -04:00
Paul Beckingham
b525fef67d Test: Merged tw-1468.t into filter.t 2015-10-25 10:38:21 -04:00
Paul Beckingham
5daf8d3101 Test: Merged tw-1418.t into search.t 2015-10-25 10:36:55 -04:00
Paul Beckingham
e32855e5ab Test: Merged tw-1456.t into filter.t 2015-10-24 11:19:59 -04:00
Paul Beckingham
44737f91e9 Test: Merged tw-1452.t into filter.t 2015-10-24 11:18:47 -04:00
Paul Beckingham
3e7ed49374 Test: Merged tw-1447.t into uda.t 2015-10-24 11:15:31 -04:00
Paul Beckingham
ce0bea73e5 Test: Merged tw-1445.t into alias.t 2015-10-24 11:13:08 -04:00
Paul Beckingham
5f641824fd Test: Merged tw-1441.t into import.t 2015-10-24 11:11:10 -04:00
Paul Beckingham
c51348b9c1 Test: Merged tw-1438.t into confirmation.t 2015-10-24 11:10:19 -04:00
Paul Beckingham
fc543c7986 Test: Merged tw-1436.t into quotes.t 2015-10-24 11:08:28 -04:00
Paul Beckingham
e15bcc004c Test: Merged tw-1430.t into project.t 2015-10-24 11:05:55 -04:00
Paul Beckingham
a5ea60e711 Test: Merged tw-1424.t into filter.t 2015-10-24 11:04:40 -04:00
Paul Beckingham
379d7dfc6e Test: Merged tw-1419.t into add.t 2015-10-24 11:01:09 -04:00
Paul Beckingham
4a1a464f0a Test: Renamed tw-1414.t to exec.t 2015-10-24 10:54:27 -04:00
Paul Beckingham
93d210e7db Test: Renamed tw-1381.t to blocked.t 2015-10-24 10:53:34 -04:00
Paul Beckingham
e20f7bee4e Test: Merged tw-1377.t into default.t 2015-10-24 10:51:20 -04:00
Paul Beckingham
8551d96490 Test: Merged tw-1359.t into add.t 2015-10-24 10:49:17 -04:00
Paul Beckingham
127075bcad Test: Merged tw-1319.t into uda_sort.t 2015-10-24 10:43:12 -04:00
Paul Beckingham
3b6c62309e Test: Renamed tw-1306.t to modify.t 2015-10-24 10:41:39 -04:00
Paul Beckingham
15adcfe1a0 Test: Merged feature.1061.t into columns.t 2015-10-24 10:39:28 -04:00
Paul Beckingham
89534afa84 Test: Renamed feature.10103.t to feedback.t 2015-10-24 10:35:51 -04:00
Paul Beckingham
205a2bd984 Test: Merged feature.725.t into dependencies.t 2015-10-24 10:33:23 -04:00
Paul Beckingham
2ca2e81a18 Test: Removed debug diagnostics 2015-10-24 10:18:43 -04:00
Paul Beckingham
18652a834d Test: Merged feature.891.t into uuid.t 2015-10-24 10:18:25 -04:00
Paul Beckingham
32960d5e17 Test: Merged tw-1300.t into dom.t 2015-10-24 10:11:19 -04:00
Paul Beckingham
6f926e6bea Test: Merged tw-1262.t into dependencies.t 2015-10-24 10:11:19 -04:00
Wilhelm Schuermann
f4ba6015a8 JSON: Improve json::decode() performance
- Improves "load" time by ~28% across all performance tests.
- Improves the "add" performance test by ~20% since "load" takes most
  of the time there.
2015-10-24 10:47:34 +02:00
Paul Beckingham
84c85b7596 Test: Merged tw-268.t into quotes.t 2015-10-23 10:38:40 -04:00
Paul Beckingham
2b69190ce2 Test: Removed redundant test 2015-10-23 10:37:18 -04:00
Paul Beckingham
909f48a371 Test: Merged feature.608.t into start.t 2015-10-23 10:22:23 -04:00
Paul Beckingham
34d737f700 Test: Merged tw-21.t into uda.t 2015-10-23 10:20:25 -04:00
Paul Beckingham
acca829aed Test: Merged t3.t.cpp into t.t.cpp 2015-10-23 10:19:17 -04:00
Paul Beckingham
bb58b796fd Task Data Parsing
- Improved the handling when parsing blank lines and empty task in the data, so
  that instead of the message:

    Taskwarrior no longer supports file format 1, originally used between 27
    November 2006 and 31 December 2007.

  We now see:

    Unrecognized Taskwarrior file format or blank line in data.

- Merged t2.t.cpp into t.t.cpp.
2015-10-23 10:13:38 -04:00
Paul Beckingham
603843821b Test: Removed useless test 2015-10-23 09:33:18 -04:00
Paul Beckingham
ba000e1a5c Test: Merged countdown.t into format.t 2015-10-23 09:32:26 -04:00
Paul Beckingham
875a3307d5 Test: Merged subproject.t into project.t 2015-10-23 09:30:21 -04:00
Paul Beckingham
3380e105f6 Test: Merged default.command.t into default.t 2015-10-23 09:21:29 -04:00
Paul Beckingham
1f30757c01 Test: Fixed error in conversion now there are no more bug.*.t scripts 2015-10-23 09:19:45 -04:00
Paul Beckingham
06ebd56be8 Test: Merged args.1.t into args.t 2015-10-23 09:15:39 -04:00
Paul Beckingham
0497939742 Test: Renamed tw-101.t to format.t 2015-10-23 09:14:11 -04:00
Paul Beckingham
ecde7d1ad2 Test: Added missing import 2015-10-23 09:12:01 -04:00
Paul Beckingham
e3727c0101 Test: Merged bug.annual.t into recurrence.t 2015-10-23 09:10:56 -04:00
Paul Beckingham
9b5f317b4a Test: Merged bug.before.t into filter.t 2015-10-23 09:09:32 -04:00
Paul Beckingham
be7159a708 Test: Merged bug.hasnt.t into filter.t 2015-10-23 09:08:36 -04:00
Paul Beckingham
470f54ce33 Test: Renamed bug.summary.t to summary.t 2015-10-23 09:07:37 -04:00
Paul Beckingham
4add78003a Test: Merged bug.bulk.t into bulk.t 2015-10-23 09:06:49 -04:00
Paul Beckingham
2b55572d06 Test: Merged bug.period.t into recurrence.t 2015-10-23 09:05:35 -04:00
Paul Beckingham
9f17bc3240 Test: Merged bug.range.t into filter.t 2015-10-23 09:02:01 -04:00
Paul Beckingham
ab73a93fd6 Test: Merged bug.annotate.t into annotate.t 2015-10-23 09:00:21 -04:00
Paul Beckingham
5cce810483 Test: Merged bug.1267.t into project.t 2015-10-23 08:58:46 -04:00
Paul Beckingham
4f7441efd3 Test: Merged bug.1254.t into calc.t 2015-10-23 08:57:26 -04:00
Paul Beckingham
9f16367847 Test: Merged bug.1063.t into uda.t 2015-10-23 08:53:14 -04:00
Paul Beckingham
95ef2b7ef2 Test: Removed unnecessary test 2015-10-23 08:51:46 -04:00
Paul Beckingham
eb8a91cec6 Test: Merged bug.1031.t into alias.t 2015-10-23 08:50:18 -04:00
Paul Beckingham
d359544b30 Test: Merged bug.1006.t into abbreviation.t 2015-10-23 08:48:20 -04:00
Paul Beckingham
3edfc4f504 Test: Merged completion.t into helpers.t 2015-10-23 08:45:58 -04:00
Paul Beckingham
158aeb5655 Test: Merged bug.986.t into dateformat.t 2015-10-23 08:41:51 -04:00
Paul Beckingham
59edb6ca87 Test: Merged bug.956.t into helpers.t 2015-10-23 08:40:26 -04:00
Paul Beckingham
9588b6f937 Test: Merged bug.954.t into uuid.t 2015-10-23 08:39:14 -04:00
Paul Beckingham
de29942142 Test: Merged bug.899.t into project.t 2015-10-23 08:36:42 -04:00
Paul Beckingham
faa6b806d2 Test: Merged bug.886.t into dateformat.t 2015-10-23 08:35:13 -04:00
Paul Beckingham
b5b005d01f Test: Merged bug.879.t into quotes.t 2015-10-23 08:31:04 -04:00
Paul Beckingham
4e178c8186 Test: Merged bug.851.t into math.t 2015-10-23 08:29:51 -04:00
Paul Beckingham
2c4a084cb0 Test: Merged bug.839.t into recurrence.t 2015-10-23 08:28:11 -04:00
Paul Beckingham
8adfe7fa20 Test: Merged bug.837.t into urgency.t 2015-10-23 08:25:52 -04:00
Paul Beckingham
1434e0366c Test: Merged bug.835.t into project.t 2015-10-23 08:23:11 -04:00
Paul Beckingham
9690cad46a Test: Merged bug.818.t into tag.t 2015-10-23 08:20:03 -04:00
Paul Beckingham
7211641370 Test: Merged bug.697.t into dependencies.t 2015-10-23 08:19:56 -04:00
Paul Beckingham
efad90e4bc Test: Removed strange and unnecessary test 2015-10-23 07:26:10 -04:00
Paul Beckingham
831476725e Test: Removed obsolete bug.656.t 2015-10-23 07:18:45 -04:00
Paul Beckingham
d9cf8b4f36 Test: Merged bug.c001.t into recurrence.t 2015-10-23 07:17:03 -04:00
Paul Beckingham
33cf2735cf Test: Merged bug.649.t into recurrence.t 2015-10-23 07:14:43 -04:00
Paul Beckingham
ed3eb31d7e Test: Removed duplicated test 2015-10-23 07:09:15 -04:00
Paul Beckingham
9eda156ea9 Test: Merged bug.441.t into substitute.t 2015-10-23 07:07:53 -04:00
Paul Beckingham
b9bbc83302 Test: Merged bug.425.t into info.t 2015-10-23 07:06:31 -04:00
Paul Beckingham
9a4a2b507c Test: Removed daylight saving sensitivity 2015-10-23 07:00:21 -04:00
Paul Beckingham
c2c6b051ff Test: Merged bug.360.t into recurrence.t 2015-10-23 06:54:03 -04:00
Paul Beckingham
ee2d15aa96 Docs: Set the tone in NEWS 2015-10-23 06:52:56 -04:00
Paul Beckingham
f393ae5969 Test: Renamed cli.t to quotes.t 2015-10-23 06:52:44 -04:00
Wilhelm Schuermann
2a2627e8a9 Test: Make version test compatible with non-beta releases 2015-10-22 13:43:40 +02:00
Federico Hernandez
dc7ea3ae8b Bumped documentation to 2.5.1 2015-10-21 23:02:37 +02:00
Federico Hernandez
28648770c0 Bumped version number to 2.5.1 2015-10-21 22:52:52 +02:00
Federico Hernandez
a9eac8bb71 Added SHA1 of tagged release commit 2015-10-21 22:50:42 +02:00
576 changed files with 8263 additions and 11770 deletions

1
.gitignore vendored
View File

@@ -18,3 +18,4 @@ CPackConfig.cmake
CPackSourceConfig.cmake
patches
*.exe
tutorials

11
AUTHORS
View File

@@ -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

View File

@@ -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)

View File

@@ -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
View File

@@ -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).

View File

@@ -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

View File

@@ -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
View File

@@ -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.
- Non­extended 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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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/>

View File

@@ -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/>

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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
View 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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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=Праздник весны и труда

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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
View 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)

View File

@@ -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.

View File

@@ -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",

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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' \

View File

@@ -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");

View File

@@ -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

View File

@@ -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;
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -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
////////////////////////////////////////////////////////////////////////////////

View File

@@ -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" ||

View File

@@ -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&);

View File

@@ -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 ();
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -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;

View File

@@ -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);
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -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
////////////////////////////////////////////////////////////////////////////////

View File

@@ -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) ||

View File

@@ -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

View File

@@ -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 ("FILTER Infix " + dump (_compiled));
infixParse (_compiled);
if (_debug)
context.debug ("FILTER Infix parsed " + dump (_compiled));
// Convert infix --> postfix.
infixToPostfix (_compiled);
if (_debug)
context.debug ("FILTER 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 (
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -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
////////////////////////////////////////////////////////////////////////////////

View File

@@ -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, ".."))

View File

@@ -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
////////////////////////////////////////////////////////////////////////////////

View File

@@ -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