-
Notifications
You must be signed in to change notification settings - Fork 2
/
testcmd.yaml
147 lines (117 loc) · 3.6 KB
/
testcmd.yaml
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
- name: help
cmd: -h
output: |
NAME:
timefor - A command-line time tracker with rofi integration
USAGE:
timefor [global options] command [command options]
COMMANDS:
start Start new activity
select Select new activity using rofi
update Update the duration of current activity (for cron use)
finish Finish current activity
reject Reject current activity
show Show current activity
report Report today's activities
daemon Update the duration for current activity and run hook if specified
db Execute sqlite3 with db file
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
- name: daemon-help
cmd: daemon -h
output: |
NAME:
timefor daemon - Update the duration for current activity and run hook if specified
USAGE:
timefor daemon [command options]
OPTIONS:
--break-interval value interval to show a break reminder (default: 1h20m0s)
--repeat-interval value interval to repeat a break reminder (default: 10m0s)
--hook value a hook command template
--help, -h show help
- name: daemon--bad-hook-template
cmd: daemon --hook 'echo "{{if}}"'
code: 1
output: |
Error: cannot render hook command: failed to parse template: template: tpl:1: missing value for if
- name: daemon--err-in-hook-cmd
cmd: daemon --hook 'exit 1'
code: 1
output: |
running hook command: exit 1
Error: cannot run hook command: exit status 1
- name: report--inactive
cmd: report
output: |
Inactive for 00:00
- name: start-succeed
cmd: start --shift 10m @go
output: New activity "@go" started
- name: update-succeed
cmd: update
- name: report--one-activity
cmd: report
output: |
Active for 00:10
@go 00:10
- name: start-failed--keep-existing
cmd: start --shift 10s @go
code: 1
output: |
Error: Keep tracking existing activity
- name: start-failed--started-must-be-latest
cmd: start --shift 1m @test
code: 1
output: |
Error: cannot insert new activity into database: started must be latest
- name: start-failed--negative-shift
cmd: start --shift -1m @go
code: 1
output: |
Error: a shift cannot be negative
- name: start-succeed--second
cmd: start @go
output: New activity "@go" started
- name: show-active--custom
cmd: show -t "{{.Duration}} {{if .Active}}{{.Name}}{{else}}OFF{{end}}"
output: "{{.Duration}} @go"
- name: show-active--custom-bad-template
cmd: show -t "{{.BadField}} {{if .Active}}{{.Name}}{{else}}OFF{{end}}"
code: 1
output: |
Error: cannot format activity: template: tpl:1:2: executing "tpl" at <.BadField>: can't evaluate field BadField in type main.Activity
- name: show-active
cmd: show
output: ☭ 00:00 @go
- name: update-succeed--name-changed
cmd: update --name @test
- name: show-active--name-changed
cmd: show
output: ☭ 00:00 @test
- name: update-succeed--name-changed-with-trailing-space
cmd: update --name '@test '
- name: show-active--name-changed-with-trailing-space
cmd: show -t "{{.FormatLabel}}!"
output: "00:00 @test!"
- name: finish
cmd: finish
- name: update-failed
cmd: update
code: 1
output: |
Error: no current activity
- name: show-disabled
cmd: show
output: ☯ 00:00 OFF
- name: show-disabled--custom
cmd: show -t "{{.Duration}} {{if .Active}}{{.Name}}{{else}}OFF{{end}}"
output: "{{.Duration}} OFF"
- name: report--two-activities
cmd: report
output: |
Active for 00:10
@go 00:10
@test 00:00
----- -----
Total 00:10