timewarrior/doc/grammar.txt
2016-04-26 22:48:16 -04:00

109 lines
2.7 KiB
Text

CLI Syntax
----------
The CLI shall have a well-defined and unambiguous grammar.
timew
timew start [<date>] [<tagset>]
timew stop [<tagset>]
timew track <filter>
timew clear <filter>
timew continue
timew [report] <report> [<filter>]
timew day [<filter>]
timew week [<filter>]
timew month [<filter>]
timew config [<name> [<value>]]
timew undo
timew tags [<filter>]
timew gaps [<filter>]
timew extensions
timew export [<filter>]
timew import <file>|- ...
timew help [<command>|<keyword>|hints|examples]
timew diagnostics
Filter
------
A filter is a combination of an <interval> and <tagset>, both being optional.
An interval is a representation of a time range with tags.
<interval>:
["from"] <date> ["to"|"-" <date>]
["from"] <date> "for" <duration>
<duration> ["before"|"after" <date>]
Examples of an interval:
2016-04-15
29th
since socm
yesterday
from yesterday to tomorrow
4wks before socm
4wks
since socm for 2wks
A tagset is a set of unique UTF-8 strings, each identifying some trackable
entity.
<tagset>:
<tag> [<tag> ...]
Examples of a tagset:
Home (1 tag)
'Fiscal Policy Alignment Project' (1 tag)
Fiscal\ Policy\ Alignment\ Project (1 tag)
Home Garden (2 tags)
A tag may have any value that is not a supported form of date or duration.
Hints
-----
There are built-in and custom hints, that look like this:
:fill
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 hints are:
:fill Fill in gap
:backfill Fill in gap, backwards only
:interrupt Identify the interval as a temporary interruption
:noreport Prevent the interval being reported
:quiet No feedback
:week Macro that means 'this week'
:debug Turns on debugging mode
:x User defined
:color Force use of color on
:nocolor Force use of color off
:yes Override confirmation
:ids Show ephemeral IDs for manipulation
It is not an error to specify extra hints, because they will be simply ignored.
Unrecognized hints yiled warnings.
--- Raw Notes ---
- 'timew import <file>' will merge data.
- A command for a daily and weekly view of exclusions is needed. To verify that
they are correctly defined. A text-based list should accompany it.
- Use :ids to show the ephemeral IDs, then use 'merge' and 'split' commands to
combine intervals. Then:
$ timew @1 modify ...
$ timew @1 @2 merge
$ timew @1 clear