timewarrior/doc/grammar.txt
2016-03-13 12:24:17 -04:00

121 lines
2.7 KiB
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

CLI Syntax
----------
The CLI shall have a well-defined and unambiguous grammar.
timew start|stop [<tagset>]
timew track <interval> [<tagset>]
timew clear <tagset>|<interval>
timew continue
timew
timew [<filter>] report <report>
timew define holidays <locale>|none
timew define holidays [work] <date>
timew define week <day>[- <day>] [, <day>] ...
timew define day [<day>] start|end <time>
timew define tag <tag>
timew define tag <tag> description <string>
timew define tag <tag> start|end <date>
timew define tag <tag> budget <number> <units> per <unit>
timew define tag <tag> budget <number> <units> total
timew define tag <tag> overlap
timew define tag <tag> color <color>
timew undo
timew tags
timew gaps [<interval>]
timew extensions
timew export [<interval>] [<tagset>]
timew import <file>|- ...
timew help [<command>|<keyword>|examples]
timew diagnostics
timew log mark|<string>
CLI Grammar
-----------
Assumed built-in types:
<datetime>
<duration>
<time>
<string>
interval: <timestamp> "-" <timestamp>
<timestamp> "to" <timestamp>
<timestamp> "for" <duration>
"from" <timestamp> "to" <timestamp>
"until" <timestamp>
"from" <timestamp>
timestamp: <day> <time>
tagset: <tag>+
tag: string
Intervals
---------
An interval defines a block of time, either using precise values, or vague
values that are interpreted according to context, yielding precise values. The
general form is:
Precise:
YYYY-MM-DDTHH:MM:SS[Z|±HH:MM]
now
8:23:00
9am
Vague (and precise interpretation):
today :backfill - now :active
this morning :backfill - 12:00:00
last tuesday YYYY-MM-DD :fill
yesterday YYYY-MM-DD :fill
An interval may be open ended:
- B
A - B
A -
A
When resolving an interval, vague terms are influenced by configured exclusions
and rules. Precise terms _always_ override rules.
Tagset
------
A tagset is a set of unique UTF-8 strings, each indentifying some trackable
entity, for example:
$ timew start Home Garden "Sprint 2016"
---- ------ -------------
tag tag tag
-------------------------
tagset
Keywords
--------
There are built-in and custom keywords, that look like this:
:fill
:quiet
They begin with a colon, and are heuristics for Timewarrior. They can override
feedback (:quiet) or offer guidance on how to create an interval (:fill). The
supported keywords are:
:fill
:backfill
:interrupt
:quiet
:x (user­defined via rules)
---