Commit graph

5883 commits

Author SHA1 Message Date
DanielMowitz
f703bd5a74 Made CmdCalendar.cpp less redundant by only calling
Context::getContext().config once per method.
2021-04-21 22:23:00 -04:00
DanielMowitz
45c67fef6e Update CmdCalendar.cpp
Converted some tabs to spaces and added braces to a for loop.
2021-04-21 22:23:00 -04:00
DanielMowitz
374b97bb66 Implemented multi-day holidays. 2021-04-21 22:23:00 -04:00
DanielMowitz
dc5ebfa612 Made the code for colorizing the calendar a little more dry. 2021-04-21 22:23:00 -04:00
Tomas Babej
bd0d907335 CLI2: Apply desugaring of plain filter args to date args
This ensures that commands like `task marc` perform description
substring search on `marc`.

Closes #2451.
2021-04-14 02:44:33 -04:00
Tomas Babej
475a16b3d4 CLI2: Fix docstring for desugarFilterPlainArgs
Desugaring is applied also for tokens of Lexer::type::identifier, make
sure the docstring correctly documents that.
2021-04-14 02:44:33 -04:00
Paolo Capriotti
856b589bac Parse 'context' verbose token correctly 2021-04-11 20:32:42 -04:00
Max Rossmannek
6546c050c5 Un-wait a waiting task when deleted 2021-04-06 23:34:32 -04:00
Max Rossmannek
33dcea68f5 Un-wait a waiting task when done
Implements #2322
2021-04-06 23:34:32 -04:00
DanielMowitz
fb6c42f375 Change nagging behavior
Don't nag if the specified set of tasks consists only of highest urgency tasks.
2021-04-04 22:06:07 -04:00
Tomas Babej
693f2f74cd CmdEdit: Respect bulk option
Since 'task edit' is a data-modification operation (that is particularly
hard to cancel mid-way), it should also respect the 'bulk' option like
all the other modification operations (mod, start...).

Closes #2428.
2021-04-03 17:57:08 -04:00
Tomas Babej
fe6a6ca93b compatibility: Explicitly specify template type to support older compilers
This makes curret development branch buildable on Ubuntu 18 / Centos 7 /
SUSE 15.
2021-04-03 15:01:39 -04:00
Tomas Babej
c701137313 CmdContext: Report context as not found if nothing was deleted 2021-04-03 15:01:39 -04:00
Tomas Babej
1bba59e972 CLI2: Move the recursion block to the right place in addContext 2021-04-03 15:01:39 -04:00
Tomas Babej
201b1c37b4 CmdContext: Allow user to define read-only / write-only contexts 2021-04-03 15:01:39 -04:00
Tomas Babej
4de23a3e20 CmdContext: Remove all types of context when deleting 2021-04-03 15:01:39 -04:00
Tomas Babej
062878022b CmdContext: Expand information provided in 'context show' 2021-04-03 15:01:39 -04:00
Tomas Babej
a558ffcd42 CmdContext: List info about both read and write context 2021-04-03 15:01:39 -04:00
Tomas Babej
351c3b025c getTaskContext: Allow getting context info for a non-active context 2021-04-03 15:01:39 -04:00
Tomas Babej
c0ded37f91 CmdContext: Discard .read/.write suffix when discovering contexts 2021-04-03 15:01:39 -04:00
Tomas Babej
41823c7939 CmdContext: Expand description 2021-04-03 15:01:39 -04:00
Tomas Babej
9a380887ee CLI2: Simplify context determination
Simlifies by offloading portion of the logic into the singleton Context
class (which has nothing to do with the task context per se, just a
implementation singleton).
2021-04-03 15:01:39 -04:00
Tomas Babej
985aab0541 CmdContext: Define both read and write context 2021-04-03 15:01:39 -04:00
Tomas Babej
5716f5abb7 CLI2: Generalize method to add context to support writeable context 2021-04-03 15:01:39 -04:00
Tomas Babej
5c3cf0f438 CLI2: Implement inserting modification arguments
Method to inject mods into the command, to be used by writeable context.
2021-04-03 15:01:39 -04:00
Tomas Babej
9128798fee CLI2: Generalize 'add' to insert arguments at arbitrary position 2021-04-03 15:01:39 -04:00
Tomas Babej
9bc726ba61 commands: Modify CmdAdd and CmdLog to use context
This only sets the command properties.
2021-04-03 15:01:39 -04:00
Tomas Babej
a2c3d224d3 CLI2: Generalize _context_filter_added latch name 2021-04-03 15:01:39 -04:00
Tomas Babej
0d1542ccd7
meta: Update various links to https 2021-03-12 07:58:04 -05:00
Tomas Babej
e221ea6571 meta: Bump libshared version 2021-03-07 12:50:04 -05:00
Rosen Penev
04454a995f clang-tidy: use raw string literals
Found with modernize-raw-string-literals

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-03-02 20:36:02 -05:00
Tomas Babej
456dfdc8cf CLI2: Handle empty parentheses expressions
Since taskwarrior is a CLI tool, it is likely that it is interacted with
programmatically. As such, expressions that a human would not type, but
are syntactically correct are bound to occur. In particular, task
currently is not able to handle empty parentheses expressions:

    task +PENDING '(' ')'

This is due to "and" operator being injected between +PENDING (which
translates to '( status = pending )' and '('.

Modify the insertJunctions to not insert the 'and' operator between two
sub-expressions if one of them is an empty parentheses expression.

Closes #1896.
2021-01-30 21:40:41 -05:00
Tomas Babej
64b6784f69 ColumnTypeString: Only input of single DOM token should be attempted to be evaluated
Attribute names are often words from natural language (such as start,
end or entry). The ColumnTypeString supports resolving DOM references,
such that task commands like 'task add proj:3.proj' work.

However, the current implementation of the ColumnTypeString::modify
only looks at the first token to determine whether the input is a DOM
reference or not. This mischaracterizes inputs like 'task add
"description:start something"', where the first token of the attribute
value looks like a DOM reference (the 'start' attribute), but is in
fact, a part of larger string.

Since all DOM references are single tokens, only interpret the input as
a possible DOM reference if and only if one token was found.

Closes #1908.
2021-01-30 21:40:41 -05:00
Tomas Babej
a1471b67fb CLI2: Do not attempt to evaluate values of string attributes 2021-01-30 21:40:41 -05:00
Jan Palus
9548bfdaba build: make sure internal libs are built as static
these libararies are not installed so don't leave the decision up to
enviroment which might build shared libraries resulting in binary
with missing deps after installation

Fixes #2403
2021-01-29 23:05:02 -05:00
Tomas Babej
2df80aac01 CmdCalendar: Default to current month if no due date is present
Previously, if no due date was set on any pending/waiting task, the
calendar output would start at the end of the currently supported date
period.

Default to current month instead.
2021-01-24 10:51:14 -05:00
Tomas Babej
0234cd8122 CmdCalendar: Support due dates up to year 9999 2021-01-24 10:51:14 -05:00
Tomas Babej
22228547ca CmdCalendar: Consider waiting status equivalent to pending for purposes of display
The purpose of displaying due dates on the calendar is to convey the
relative business of any given day. Waiting status signifies a task
should not be displayed in reports yet, but for the purposes of
planning, it should be displayed in the calendar overview.

Closes #2393.
2021-01-24 10:51:14 -05:00
Tomas Babej
05e7c2aff2 Lexer: Do not allow leading zero for two and more digit integers 2021-01-24 03:08:10 -05:00
Tomas Babej
6a33bb8656 Lexer: Do not allow leading zero for number type 2021-01-24 03:08:10 -05:00
Tomas Babej
5aa3073703 libshared: Bump libshared to extend Duration value support 2021-01-18 02:59:11 -05:00
Tomas Babej
ef1e889262 ColTypeDate: Do not explicitly add now to relative dates
Relative dates are now implicitly anchored around now datetime point
during casting, hence there is no reason to do this anymore.
2021-01-18 02:59:11 -05:00
Tomas Babej
5e0fc1caab Variant: Ensure implmentation of addition/subtraction of dates/durations does not involve casting
Implicit casting of a duration anchors it around the 'now' point in
time, which would throw off the conversion.
2021-01-18 02:59:11 -05:00
Tomas Babej
7242accb58 Variant: Convert durations into dates as implicitly anchored around now
The _period attribute holds the number of seconds that the Duration
holds, while _date attribute holds the number of seconds since the
beginning of unix epoch (also known as epoch time). As such, it does not
make sense to convert _period directly into _date.

Interpret _period as offset relative to current unix epoch time.

Closes #2390.
2021-01-18 02:59:11 -05:00
Tomas Babej
1855d2c729
libshared: Bump version 2021-01-16 18:47:40 -05:00
indev
098be0747d fix: remove lock file on interruption of 'task edit' (#2292) 2021-01-14 18:16:34 -05:00
Jochen Sprickerhof
663c6575ce Use str_replace from libshared 2021-01-07 22:37:04 -05:00
Jochen Sprickerhof
a95205357c Support editing multi-line annotations (Closes: #2283)
Since e4b9c1f annotations where JSON encoded in task edit to escape
new lines (\n). But other strings where mangled as well, like https://
becoming https:\/\/, making it hard to edit.

This patch removes the JSON encoding and indents new lines instead.
2021-01-07 22:37:04 -05:00
Tomas Babej
9017cd6e53
doc: Update copyright to 2021 2021-01-02 02:48:22 -05:00
Tomas Babej
2ebf4b864d
ColTypeNumeric: Support date and duration variants
If the lexer identifies an expression as an date or a duration, it
should be re-cast into integer value.

Closes #2101.
2021-01-02 00:21:02 -05:00