doing 2.0.3.pre → 2.0.8.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +40 -1
  3. data/Gemfile.lock +1 -1
  4. data/README.md +1 -1
  5. data/bin/doing +316 -114
  6. data/doing.rdoc +244 -19
  7. data/example_plugin.rb +1 -1
  8. data/generate_completions.sh +1 -0
  9. data/lib/completion/_doing.zsh +179 -127
  10. data/lib/completion/doing.bash +60 -27
  11. data/lib/completion/doing.fish +74 -23
  12. data/lib/doing/cli_status.rb +4 -0
  13. data/lib/doing/configuration.rb +2 -0
  14. data/lib/doing/errors.rb +22 -15
  15. data/lib/doing/item.rb +12 -11
  16. data/lib/doing/log_adapter.rb +27 -25
  17. data/lib/doing/plugin_manager.rb +1 -1
  18. data/lib/doing/plugins/export/json_export.rb +2 -2
  19. data/lib/doing/plugins/export/template_export.rb +1 -1
  20. data/lib/doing/plugins/import/calendar_import.rb +7 -1
  21. data/lib/doing/plugins/import/doing_import.rb +6 -6
  22. data/lib/doing/plugins/import/timing_import.rb +7 -1
  23. data/lib/doing/string.rb +9 -7
  24. data/lib/doing/version.rb +1 -1
  25. data/lib/doing/wwid.rb +160 -92
  26. data/lib/examples/commands/autotag.rb +63 -0
  27. data/lib/examples/commands/wiki.rb +1 -0
  28. data/lib/examples/plugins/say_export.rb +1 -1
  29. data/lib/examples/plugins/{templates → wiki_export/templates}/wiki.css +0 -0
  30. data/lib/examples/plugins/{templates → wiki_export/templates}/wiki.haml +0 -0
  31. data/lib/examples/plugins/{templates → wiki_export/templates}/wiki_index.haml +0 -0
  32. data/lib/examples/plugins/{wiki_export.rb → wiki_export/wiki_export.rb} +0 -0
  33. data/scripts/generate_bash_completions.rb +3 -2
  34. data/scripts/generate_fish_completions.rb +4 -1
  35. data/scripts/generate_zsh_completions.rb +44 -39
  36. metadata +7 -7
  37. data/doing.fish +0 -278
@@ -55,14 +55,16 @@ complete -f -c doing -n '__fish_doing_using_command view' -a '(__fish_doing_comp
55
55
  complete -f -c doing -n '__fish_doing_using_command template' -a '(__fish_doing_complete_templates)'
56
56
  complete -f -c doing -s t -l type -x -n '__fish_doing_using_command import' -a '(__fish_doing_import_plugins)'
57
57
 
58
+ complete -xc doing -n '__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from (doing help -c)' -a "(doing help -c)"
58
59
 
59
60
  complete -xc doing -n '__fish_doing_needs_command' -a 'add_section' -d Add\ a\ new\ section\ to\ the\ \"doing\"\ file
60
61
  complete -xc doing -n '__fish_doing_needs_command' -a 'again resume' -d Repeat\ last\ entry\ as\ new\ entry
61
- complete -xc doing -n '__fish_doing_needs_command' -a 'archive' -d Move\ entries\ between\ sections
62
+ complete -xc doing -n '__fish_doing_needs_command' -a 'archive move' -d Move\ entries\ between\ sections
63
+ complete -xc doing -n '__fish_doing_needs_command' -a 'autotag' -d Autotag\ last\ entry\ or\ filtered\ entries
62
64
  complete -xc doing -n '__fish_doing_needs_command' -a 'cancel' -d End\ last\ X\ entries\ with\ no\ time\ tracked
63
65
  complete -xc doing -n '__fish_doing_needs_command' -a 'choose' -d Select\ a\ section\ to\ display\ from\ a\ menu
64
66
  complete -xc doing -n '__fish_doing_needs_command' -a 'colors' -d List\ available\ color\ variables\ for\ configuration\ templates\ and\ views
65
- complete -xc doing -n '__fish_doing_needs_command' -a 'config' -d Edit\ the\ configuration\ file
67
+ complete -xc doing -n '__fish_doing_needs_command' -a 'config' -d Edit\ the\ configuration\ file\ or\ output\ a\ value\ from\ it
66
68
  complete -xc doing -n '__fish_doing_needs_command' -a 'done did' -d Add\ a\ completed\ item\ with\ @done\(date\)
67
69
  complete -xc doing -n '__fish_doing_needs_command' -a 'finish' -d Mark\ last\ X\ entries\ as\ @done
68
70
  complete -xc doing -n '__fish_doing_needs_command' -a 'grep search' -d Search\ for\ entries
@@ -70,7 +72,7 @@ complete -xc doing -n '__fish_doing_needs_command' -a 'help' -d Shows\ a\ list\
70
72
  complete -xc doing -n '__fish_doing_needs_command' -a 'import' -d Import\ entries\ from\ an\ external\ source
71
73
  complete -xc doing -n '__fish_doing_needs_command' -a 'last' -d Show\ the\ last\ entry
72
74
  complete -xc doing -n '__fish_doing_needs_command' -a 'later' -d Add\ an\ item\ to\ the\ Later\ section
73
- complete -xc doing -n '__fish_doing_needs_command' -a 'mark flag' -d Mark\ last\ entry\ as\ highlighted
75
+ complete -xc doing -n '__fish_doing_needs_command' -a 'mark flag' -d Mark\ last\ entry\ as\ flagged
74
76
  complete -xc doing -n '__fish_doing_needs_command' -a 'meanwhile' -d Finish\ any\ running\ @meanwhile\ tasks\ and\ optionally\ create\ a\ new\ one
75
77
  complete -xc doing -n '__fish_doing_needs_command' -a 'note' -d Add\ a\ note\ to\ the\ last\ entry
76
78
  complete -xc doing -n '__fish_doing_needs_command' -a 'now next' -d Add\ an\ entry
@@ -78,6 +80,7 @@ complete -xc doing -n '__fish_doing_needs_command' -a 'on' -d List\ entries\ for
78
80
  complete -xc doing -n '__fish_doing_needs_command' -a 'open' -d Open\ the\ \"doing\"\ file\ in\ an\ editor
79
81
  complete -xc doing -n '__fish_doing_needs_command' -a 'plugins' -d List\ installed\ plugins
80
82
  complete -xc doing -n '__fish_doing_needs_command' -a 'recent' -d List\ recent\ entries
83
+ complete -xc doing -n '__fish_doing_needs_command' -a 'reset begin' -d Reset\ the\ start\ time\ of\ an\ entry
81
84
  complete -xc doing -n '__fish_doing_needs_command' -a 'rotate' -d Move\ entries\ to\ archive\ file
82
85
  complete -xc doing -n '__fish_doing_needs_command' -a 'sections' -d List\ sections
83
86
  complete -xc doing -n '__fish_doing_needs_command' -a 'select' -d Display\ an\ interactive\ menu\ to\ perform\ operations
@@ -85,46 +88,65 @@ complete -xc doing -n '__fish_doing_needs_command' -a 'show' -d List\ all\ entri
85
88
  complete -xc doing -n '__fish_doing_needs_command' -a 'since' -d List\ entries\ since\ a\ date
86
89
  complete -xc doing -n '__fish_doing_needs_command' -a 'tag' -d Add\ tag\(s\)\ to\ last\ entry
87
90
  complete -xc doing -n '__fish_doing_needs_command' -a 'template' -d Output\ HTML
91
+ complete -xc doing -n '__fish_doing_needs_command' -a 'test' -d Test\ Stuff
88
92
  complete -xc doing -n '__fish_doing_needs_command' -a 'today' -d List\ entries\ from\ today
89
93
  complete -xc doing -n '__fish_doing_needs_command' -a 'undo' -d Undo\ the\ last\ change\ to\ the\ doing_file
90
94
  complete -xc doing -n '__fish_doing_needs_command' -a 'view' -d Display\ a\ user-created\ view
91
95
  complete -xc doing -n '__fish_doing_needs_command' -a 'views' -d List\ available\ custom\ views
96
+ complete -xc doing -n '__fish_doing_needs_command' -a 'wiki' -d Output\ a\ tag\ wiki
92
97
  complete -xc doing -n '__fish_doing_needs_command' -a 'yesterday' -d List\ entries\ from\ yesterday
93
98
  complete -c doing -l bool -f -r -n '__fish_doing_using_command again resume' -d Boolean\ used\ to\ combine\ multiple\ tags
94
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command again resume' -d Edit\ duplicated\ entry\ with\ before\ adding
99
+ complete -c doing -l editor -s e -f -n '__fish_doing_using_command again resume' -d Edit\ duplicated\ entry\ with\ vim\ before\ adding
100
+ complete -c doing -l interactive -s i -f -n '__fish_doing_using_command again resume' -d Select\ item\ to\ resume\ from\ a\ menu\ of\ matching\ entries
95
101
  complete -c doing -l in -f -r -n '__fish_doing_using_command again resume' -d Add\ new\ entry\ to\ section
96
102
  complete -c doing -l note -s n -f -r -n '__fish_doing_using_command again resume' -d Note
97
103
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command again resume' -d Get\ last\ entry\ from\ a\ specific\ section
98
104
  complete -c doing -l search -f -r -n '__fish_doing_using_command again resume' -d Repeat\ last\ entry\ matching\ search
99
105
  complete -c doing -l tag -f -r -n '__fish_doing_using_command again resume' -d Repeat\ last\ entry\ matching\ tags
100
- complete -c doing -l before -f -r -n '__fish_doing_using_command archive' -d Archive\ entries\ older\ than\ date
101
- complete -c doing -l bool -f -r -n '__fish_doing_using_command archive' -d Tag\ boolean
102
- complete -c doing -l keep -s k -f -r -n '__fish_doing_using_command archive' -d How\ many\ items\ to\ keep
103
- complete -c doing -l label -f -n '__fish_doing_using_command archive' -d Label\ moved\ items\ with\ @from\(SECTION_NAME\)
104
- complete -c doing -l search -f -r -n '__fish_doing_using_command archive' -d Search\ filter
105
- complete -c doing -l to -s t -f -r -n '__fish_doing_using_command archive' -d Move\ entries\ to
106
- complete -c doing -l tag -f -r -n '__fish_doing_using_command archive' -d Tag\ filter
106
+ complete -c doing -l before -f -r -n '__fish_doing_using_command archive move' -d Archive\ entries\ older\ than\ date
107
+ complete -c doing -l bool -f -r -n '__fish_doing_using_command archive move' -d Tag\ boolean
108
+ complete -c doing -l keep -s k -f -r -n '__fish_doing_using_command archive move' -d How\ many\ items\ to\ keep
109
+ complete -c doing -l label -f -n '__fish_doing_using_command archive move' -d Label\ moved\ items\ with\ @from\(SECTION_NAME\)
110
+ complete -c doing -l search -f -r -n '__fish_doing_using_command archive move' -d Search\ filter
111
+ complete -c doing -l to -s t -f -r -n '__fish_doing_using_command archive move' -d Move\ entries\ to
112
+ complete -c doing -l tag -f -r -n '__fish_doing_using_command archive move' -d Tag\ filter
113
+ complete -c doing -l bool -f -r -n '__fish_doing_using_command autotag' -d Boolean
114
+ complete -c doing -l count -s c -f -r -n '__fish_doing_using_command autotag' -d How\ many\ recent\ entries\ to\ autotag
115
+ complete -c doing -l force -f -n '__fish_doing_using_command autotag' -d Don\'t\ ask\ permission\ to\ autotag\ all\ entries\ when\ count\ is\ 0
116
+ complete -c doing -l interactive -s i -f -n '__fish_doing_using_command autotag' -d Select\ item\(s\)\ to\ tag\ from\ a\ menu\ of\ matching\ entries
117
+ complete -c doing -l section -s s -f -r -n '__fish_doing_using_command autotag' -d Section
118
+ complete -c doing -l search -f -r -n '__fish_doing_using_command autotag' -d Autotag\ entries\ matching\ search\ filter
119
+ complete -c doing -l tag -f -r -n '__fish_doing_using_command autotag' -d Autotag\ the\ last\ X\ entries\ containing\ TAG
120
+ complete -c doing -l unfinished -s u -f -n '__fish_doing_using_command autotag' -d Autotag\ last\ entry
107
121
  complete -c doing -l archive -s a -f -n '__fish_doing_using_command cancel' -d Archive\ entries
108
122
  complete -c doing -l bool -f -r -n '__fish_doing_using_command cancel' -d Boolean
123
+ complete -c doing -l interactive -s i -f -n '__fish_doing_using_command cancel' -d Select\ item\(s\)\ to\ cancel\ from\ a\ menu\ of\ matching\ entries
109
124
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command cancel' -d Section
110
125
  complete -c doing -l tag -f -r -n '__fish_doing_using_command cancel' -d Cancel\ the\ last\ X\ entries\ containing\ TAG
111
126
  complete -c doing -l unfinished -s u -f -n '__fish_doing_using_command cancel' -d Cancel\ last\ entry
127
+ complete -c doing -F -n '__fish_doing_using_command config'
128
+ complete -c doing -l dump -s d -f -n '__fish_doing_using_command config' -d Show\ a\ config\ key\ value\ based\ on\ arguments
112
129
  complete -c doing -l editor -s e -f -r -n '__fish_doing_using_command config' -d Editor\ to\ use
130
+ complete -c doing -l output -s o -f -r -n '__fish_doing_using_command config' -d Format\ for\ --dump
113
131
  complete -c doing -l update -s u -f -n '__fish_doing_using_command config' -d Update\ config\ file\ with\ missing\ configuration\ options
114
132
  complete -c doing -l archive -s a -f -n '__fish_doing_using_command done did' -d Immediately\ archive\ the\ entry
115
133
  complete -c doing -l at -f -r -n '__fish_doing_using_command done did' -d Set\ finish\ date\ to\ specific\ date/time
116
134
  complete -c doing -l back -s b -f -r -n '__fish_doing_using_command done did' -d Backdate\ start\ date\ by\ interval\ \[4pm\|20m\|2h\|yesterday\ noon\]
117
135
  complete -c doing -l date -f -n '__fish_doing_using_command done did' -d Include\ date
118
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command done did' -d Edit\ entry\ with
136
+ complete -c doing -l editor -s e -f -n '__fish_doing_using_command done did' -d Edit\ entry\ with\ vim
137
+ complete -c doing -l note -s n -f -r -n '__fish_doing_using_command done did' -d Include\ a\ note
119
138
  complete -c doing -l remove -s r -f -n '__fish_doing_using_command done did' -d Remove\ @done\ tag
120
139
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command done did' -d Section
121
140
  complete -c doing -l took -s t -f -r -n '__fish_doing_using_command done did' -d Set\ completion\ date\ to\ start\ date\ plus\ interval
141
+ complete -c doing -l unfinished -s u -f -n '__fish_doing_using_command done did' -d Finish\ last\ entry\ not\ already\ marked\ @done
122
142
  complete -c doing -l archive -s a -f -n '__fish_doing_using_command finish' -d Archive\ entries
123
143
  complete -c doing -l at -f -r -n '__fish_doing_using_command finish' -d Set\ finish\ date\ to\ specific\ date/time
124
144
  complete -c doing -l auto -f -n '__fish_doing_using_command finish' -d Auto-generate\ finish\ dates\ from\ next\ entry\'s\ start\ time
125
145
  complete -c doing -l back -s b -f -r -n '__fish_doing_using_command finish' -d Backdate\ completed\ date\ to\ date\ string\ \[4pm\|20m\|2h\|yesterday\ noon\]
126
146
  complete -c doing -l bool -f -r -n '__fish_doing_using_command finish' -d Boolean
127
147
  complete -c doing -l date -f -n '__fish_doing_using_command finish' -d Include\ date
148
+ complete -c doing -l interactive -s i -f -n '__fish_doing_using_command finish' -d Select\ item\(s\)\ to\ finish\ from\ a\ menu\ of\ matching\ entries
149
+ complete -c doing -l remove -s r -f -n '__fish_doing_using_command finish' -d Remove\ done\ tag
128
150
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command finish' -d Section
129
151
  complete -c doing -l search -f -r -n '__fish_doing_using_command finish' -d Finish\ the\ last\ X\ entries\ matching\ search\ filter
130
152
  complete -c doing -l took -s t -f -r -n '__fish_doing_using_command finish' -d Set\ the\ completed\ date\ to\ the\ start\ date\ plus\ XX\[hmd\]
@@ -152,28 +174,39 @@ complete -c doing -l search -f -r -n '__fish_doing_using_command import' -d Onl
152
174
  complete -c doing -l tag -f -r -n '__fish_doing_using_command import' -d Tag\ all\ imported\ entries
153
175
  complete -c doing -l type -f -r -n '__fish_doing_using_command import' -d Import\ type
154
176
  complete -c doing -l bool -f -r -n '__fish_doing_using_command last' -d Tag\ boolean
155
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command last' -d Edit\ entry\ with
177
+ complete -c doing -l editor -s e -f -n '__fish_doing_using_command last' -d Edit\ entry\ with\ vim
156
178
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command last' -d Specify\ a\ section
157
179
  complete -c doing -l search -f -r -n '__fish_doing_using_command last' -d Search\ filter
158
180
  complete -c doing -l tag -f -r -n '__fish_doing_using_command last' -d Tag\ filter
159
181
  complete -c doing -l back -s b -f -r -n '__fish_doing_using_command later' -d Backdate\ start\ time\ to\ date\ string\ \[4pm\|20m\|2h\|yesterday\ noon\]
160
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command later' -d Edit\ entry\ with
182
+ complete -c doing -l editor -s e -f -n '__fish_doing_using_command later' -d Edit\ entry\ with\ vim
161
183
  complete -c doing -l note -s n -f -r -n '__fish_doing_using_command later' -d Note
162
- complete -c doing -l remove -s r -f -n '__fish_doing_using_command mark flag' -d Remove\ mark
184
+ complete -c doing -l bool -f -r -n '__fish_doing_using_command mark flag' -d Boolean
185
+ complete -c doing -l count -s c -f -r -n '__fish_doing_using_command mark flag' -d How\ many\ recent\ entries\ to\ tag
186
+ complete -c doing -l date -s d -f -n '__fish_doing_using_command mark flag' -d Include\ current\ date/time\ with\ tag
187
+ complete -c doing -l force -f -n '__fish_doing_using_command mark flag' -d Don\'t\ ask\ permission\ to\ flag\ all\ entries\ when\ count\ is\ 0
188
+ complete -c doing -l interactive -s i -f -n '__fish_doing_using_command mark flag' -d Select\ item\(s\)\ to\ flag\ from\ a\ menu\ of\ matching\ entries
189
+ complete -c doing -l remove -s r -f -n '__fish_doing_using_command mark flag' -d Remove\ flag
163
190
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command mark flag' -d Section
164
- complete -c doing -l unfinished -s u -f -n '__fish_doing_using_command mark flag' -d Mark\ last\ entry\ not\ marked\ @done
191
+ complete -c doing -l search -f -r -n '__fish_doing_using_command mark flag' -d Flag\ the\ last\ entry\ matching\ search\ filter
192
+ complete -c doing -l tag -f -r -n '__fish_doing_using_command mark flag' -d Flag\ the\ last\ entry\ containing\ TAG
193
+ complete -c doing -l unfinished -s u -f -n '__fish_doing_using_command mark flag' -d Flag\ last\ entry
165
194
  complete -c doing -l archive -s a -f -n '__fish_doing_using_command meanwhile' -d Archive\ previous\ @meanwhile\ entry
166
195
  complete -c doing -l back -s b -f -r -n '__fish_doing_using_command meanwhile' -d Backdate\ start\ date\ for\ new\ entry\ to\ date\ string\ \[4pm\|20m\|2h\|yesterday\ noon\]
167
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command meanwhile' -d Edit\ entry\ with
196
+ complete -c doing -l editor -s e -f -n '__fish_doing_using_command meanwhile' -d Edit\ entry\ with\ vim
168
197
  complete -c doing -l note -s n -f -r -n '__fish_doing_using_command meanwhile' -d Note
169
198
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command meanwhile' -d Section
170
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command note' -d Edit\ entry\ with
199
+ complete -c doing -l bool -f -r -n '__fish_doing_using_command note' -d Boolean
200
+ complete -c doing -l editor -s e -f -n '__fish_doing_using_command note' -d Edit\ entry\ with\ vim
201
+ complete -c doing -l interactive -s i -f -n '__fish_doing_using_command note' -d Select\ item\ for\ new\ note\ from\ a\ menu\ of\ matching\ entries
171
202
  complete -c doing -l remove -s r -f -n '__fish_doing_using_command note' -d Replace/Remove\ last\ entry\'s\ note
172
203
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command note' -d Section
204
+ complete -c doing -l search -f -r -n '__fish_doing_using_command note' -d Add/remove\ note\ from\ last\ entry\ matching\ search\ filter
205
+ complete -c doing -l tag -f -r -n '__fish_doing_using_command note' -d Add/remove\ note\ from\ last\ entry\ matching\ tag
173
206
  complete -c doing -l back -s b -f -r -n '__fish_doing_using_command now next' -d Backdate\ start\ time\ \[4pm\|20m\|2h\|yesterday\ noon\]
174
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command now next' -d Edit\ entry\ with
207
+ complete -c doing -l editor -s e -f -n '__fish_doing_using_command now next' -d Edit\ entry\ with\ vim
175
208
  complete -c doing -l finish_last -s f -f -n '__fish_doing_using_command now next' -d Timed\ entry
176
- complete -c doing -l note -s n -f -r -n '__fish_doing_using_command now next' -d Note
209
+ complete -c doing -l note -s n -f -r -n '__fish_doing_using_command now next' -d Include\ a\ note
177
210
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command now next' -d Section
178
211
  complete -c doing -l output -s o -f -r -n '__fish_doing_using_command on' -d Output\ to\ export\ format
179
212
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command on' -d Section
@@ -182,13 +215,19 @@ complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command on' -d Sort\
182
215
  complete -c doing -l totals -f -n '__fish_doing_using_command on' -d Show\ time\ totals\ at\ the\ end\ of\ output
183
216
  complete -c doing -l app -s a -f -r -n '__fish_doing_using_command open' -d Open\ with\ app\ name
184
217
  complete -c doing -l bundle_id -s b -f -r -n '__fish_doing_using_command open' -d Open\ with\ app\ bundle\ id
185
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command open' -d Open\ with\ \$EDITOR
186
218
  complete -c doing -l column -s c -f -n '__fish_doing_using_command plugins' -d List\ in\ single\ column\ for\ completion
187
219
  complete -c doing -l type -s t -f -r -n '__fish_doing_using_command plugins' -d List\ plugins\ of\ type
220
+ complete -c doing -l interactive -s i -f -n '__fish_doing_using_command recent' -d Select\ from\ a\ menu\ of\ matching\ entries\ to\ perform\ additional\ operations
188
221
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command recent' -d Section
189
222
  complete -c doing -l times -s t -f -n '__fish_doing_using_command recent' -d Show\ time\ intervals\ on\ @done\ tasks
190
223
  complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command recent' -d Sort\ tags\ by
191
224
  complete -c doing -l totals -f -n '__fish_doing_using_command recent' -d Show\ intervals\ with\ totals\ at\ the\ end\ of\ output
225
+ complete -c doing -l bool -f -r -n '__fish_doing_using_command reset begin' -d Boolean
226
+ complete -c doing -l interactive -s i -f -n '__fish_doing_using_command reset begin' -d Select\ from\ a\ menu\ of\ matching\ entries
227
+ complete -c doing -l resume -s r -f -n '__fish_doing_using_command reset begin' -d Resume\ entry
228
+ complete -c doing -l section -s s -f -r -n '__fish_doing_using_command reset begin' -d Set\ the\ start\ date\ of\ an\ item\ to\ now
229
+ complete -c doing -l search -f -r -n '__fish_doing_using_command reset begin' -d Reset\ last\ entry\ matching\ search\ filter
230
+ complete -c doing -l tag -f -r -n '__fish_doing_using_command reset begin' -d Reset\ last\ entry\ matching\ tag
192
231
  complete -c doing -l before -f -r -n '__fish_doing_using_command rotate' -d Rotate\ entries\ older\ than\ date
193
232
  complete -c doing -l bool -f -r -n '__fish_doing_using_command rotate' -d Tag\ boolean
194
233
  complete -c doing -l keep -s k -f -r -n '__fish_doing_using_command rotate' -d How\ many\ items\ to\ keep\ in\ each\ section
@@ -197,6 +236,7 @@ complete -c doing -l search -f -r -n '__fish_doing_using_command rotate' -d Sea
197
236
  complete -c doing -l tag -f -r -n '__fish_doing_using_command rotate' -d Tag\ filter
198
237
  complete -c doing -l column -s c -f -n '__fish_doing_using_command sections' -d List\ in\ single\ column
199
238
  complete -c doing -l archive -s a -f -n '__fish_doing_using_command select' -d Archive\ selected\ items
239
+ complete -c doing -l resume -f -n '__fish_doing_using_command select' -d Copy\ selection\ as\ a\ new\ entry\ with\ current\ time\ and\ no\ @done\ tag
200
240
  complete -c doing -l cancel -s c -f -n '__fish_doing_using_command select' -d Cancel\ selected\ items
201
241
  complete -c doing -l delete -s d -f -n '__fish_doing_using_command select' -d Delete\ selected\ items
202
242
  complete -c doing -l editor -s e -f -n '__fish_doing_using_command select' -d Edit\ selected\ item\(s\)
@@ -206,7 +246,7 @@ complete -c doing -l force -f -n '__fish_doing_using_command select' -d Perfor
206
246
  complete -c doing -l move -s m -f -r -n '__fish_doing_using_command select' -d Move\ selected\ items\ to\ section
207
247
  complete -c doing -l menu -f -n '__fish_doing_using_command select' -d Use\ --no-menu\ to\ skip\ the\ interactive\ menu
208
248
  complete -c doing -l output -s o -f -r -n '__fish_doing_using_command select' -d Output\ entries\ to\ format
209
- complete -c doing -l query -s q -f -r -n '__fish_doing_using_command select' -d Initial\ search\ query\ for\ filtering
249
+ complete -c doing -l search -f -r -n '__fish_doing_using_command select' -d Initial\ search\ query\ for\ filtering
210
250
  complete -c doing -l remove -s r -f -n '__fish_doing_using_command select' -d Reverse\ -c
211
251
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command select' -d Select\ from\ a\ specific\ section
212
252
  complete -c doing -l save_to -f -r -n '__fish_doing_using_command select' -d Save\ selected\ entries\ to\ file\ using\ --output\ format
@@ -217,6 +257,7 @@ complete -c doing -l bool -s b -f -r -n '__fish_doing_using_command show' -d Tag
217
257
  complete -c doing -l before -f -r -n '__fish_doing_using_command show' -d View\ entries\ older\ than\ date
218
258
  complete -c doing -l count -s c -f -r -n '__fish_doing_using_command show' -d Max\ count\ to\ show
219
259
  complete -c doing -l from -s f -f -r -n '__fish_doing_using_command show' -d Date\ range\ to\ show
260
+ complete -c doing -l interactive -s i -f -n '__fish_doing_using_command show' -d Select\ from\ a\ menu\ of\ matching\ entries\ to\ perform\ additional\ operations
220
261
  complete -c doing -l output -s o -f -r -n '__fish_doing_using_command show' -d Output\ to\ export\ format
221
262
  complete -c doing -l only_timed -f -n '__fish_doing_using_command show' -d Only\ show\ items\ with\ recorded\ time\ intervals
222
263
  complete -c doing -l sort -s s -f -r -n '__fish_doing_using_command show' -d Sort\ order
@@ -236,6 +277,7 @@ complete -c doing -l bool -f -r -n '__fish_doing_using_command tag' -d Boolean
236
277
  complete -c doing -l count -s c -f -r -n '__fish_doing_using_command tag' -d How\ many\ recent\ entries\ to\ tag
237
278
  complete -c doing -l date -s d -f -n '__fish_doing_using_command tag' -d Include\ current\ date/time\ with\ tag
238
279
  complete -c doing -l force -f -n '__fish_doing_using_command tag' -d Don\'t\ ask\ permission\ to\ tag\ all\ entries\ when\ count\ is\ 0
280
+ complete -c doing -l interactive -s i -f -n '__fish_doing_using_command tag' -d Select\ item\(s\)\ to\ tag\ from\ a\ menu\ of\ matching\ entries
239
281
  complete -c doing -l remove -s r -f -n '__fish_doing_using_command tag' -d Remove\ given\ tag\(s\)
240
282
  complete -c doing -l regex -f -n '__fish_doing_using_command tag' -d Interpret\ tag\ string\ as\ regular\ expression
241
283
  complete -c doing -l rename -f -r -n '__fish_doing_using_command tag' -d Replace\ existing\ tag\ with\ tag\ argument
@@ -257,6 +299,7 @@ complete -c doing -l bool -s b -f -r -n '__fish_doing_using_command view' -d Tag
257
299
  complete -c doing -l before -f -r -n '__fish_doing_using_command view' -d View\ entries\ older\ than\ date
258
300
  complete -c doing -l count -s c -f -r -n '__fish_doing_using_command view' -d Count\ to\ display
259
301
  complete -c doing -l color -f -n '__fish_doing_using_command view' -d Include\ colors\ in\ output
302
+ complete -c doing -l interactive -s i -f -n '__fish_doing_using_command view' -d Select\ from\ a\ menu\ of\ matching\ entries\ to\ perform\ additional\ operations
260
303
  complete -c doing -l output -s o -f -r -n '__fish_doing_using_command view' -d Output\ to\ export\ format
261
304
  complete -c doing -l only_timed -f -n '__fish_doing_using_command view' -d Only\ show\ items\ with\ recorded\ time\ intervals
262
305
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command view' -d Section
@@ -267,6 +310,14 @@ complete -c doing -l tag_order -f -r -n '__fish_doing_using_command view' -d Ta
267
310
  complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command view' -d Sort\ tags\ by
268
311
  complete -c doing -l totals -f -n '__fish_doing_using_command view' -d Show\ intervals\ with\ totals\ at\ the\ end\ of\ output
269
312
  complete -c doing -l column -s c -f -n '__fish_doing_using_command views' -d List\ in\ single\ column
313
+ complete -c doing -l after -f -r -n '__fish_doing_using_command wiki' -d Include\ entries\ newer\ than\ date
314
+ complete -c doing -l bool -s b -f -r -n '__fish_doing_using_command wiki' -d Tag\ boolean
315
+ complete -c doing -l before -f -r -n '__fish_doing_using_command wiki' -d Include\ entries\ older\ than\ date
316
+ complete -c doing -l from -s f -f -r -n '__fish_doing_using_command wiki' -d Date\ range\ to\ include
317
+ complete -c doing -l only_timed -f -n '__fish_doing_using_command wiki' -d Only\ show\ items\ with\ recorded\ time\ intervals
318
+ complete -c doing -l section -s s -f -r -n '__fish_doing_using_command wiki' -d Section\ to\ rotate
319
+ complete -c doing -l search -f -r -n '__fish_doing_using_command wiki' -d Search\ filter
320
+ complete -c doing -l tag -f -r -n '__fish_doing_using_command wiki' -d Tag\ filter
270
321
  complete -c doing -l after -f -r -n '__fish_doing_using_command yesterday' -d View\ entries\ after\ specified\ time
271
322
  complete -c doing -l before -f -r -n '__fish_doing_using_command yesterday' -d View\ entries\ before\ specified\ time
272
323
  complete -c doing -l output -s o -f -r -n '__fish_doing_using_command yesterday' -d Output\ to\ export\ format
@@ -275,4 +326,4 @@ complete -c doing -l times -s t -f -n '__fish_doing_using_command yesterday' -d
275
326
  complete -c doing -l tag_order -f -r -n '__fish_doing_using_command yesterday' -d Tag\ sort\ direction
276
327
  complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command yesterday' -d Sort\ tags\ by
277
328
  complete -c doing -l totals -f -n '__fish_doing_using_command yesterday' -d Show\ time\ totals\ at\ the\ end\ of\ output
278
- complete -f -c doing -s o -l output -x -n '__fish_doing_using_command grep search on select show since today view yesterday' -a '(__fish_doing_export_plugins)'
329
+ complete -f -c doing -s o -l output -x -n '__fish_doing_using_command config grep search on select show since today view yesterday' -a '(__fish_doing_export_plugins)'
@@ -18,6 +18,10 @@ module Status
18
18
  $stderr.print format("#{esc['kill']}#{esc['boldyellow']}> #{esc['whiteboard']}%s#{esc['default']}%s", msg, reset ? "\r" : "\n")
19
19
  end
20
20
 
21
+ def clear
22
+ $stderr.print format("\r#{esc['kill']}")
23
+ end
24
+
21
25
  def esc
22
26
  e = {}
23
27
  e['kill'] = "\033[2K"
@@ -31,6 +31,8 @@ module Doing
31
31
  'never_time' => [],
32
32
  'never_finish' => [],
33
33
 
34
+ 'timer_format' => 'text',
35
+
34
36
  'templates' => {
35
37
  'default' => {
36
38
  'date_format' => '%Y-%m-%d %H:%M',
data/lib/doing/errors.rb CHANGED
@@ -2,53 +2,61 @@
2
2
 
3
3
  module Doing
4
4
  module Errors
5
-
6
5
  class UserCancelled < ::StandardError
7
- def initialize(msg='Cancelled')
6
+ def initialize(msg = 'Cancelled', topic = 'Exited:')
8
7
  Doing.logger.output_results
9
- Doing.logger.log_now(:warn, 'Exited:', msg)
8
+ Doing.logger.log_now(:warn, topic, msg)
10
9
  Process.exit 1
11
10
  end
12
11
  end
13
12
 
14
13
  class EmptyInput < ::StandardError
15
- def initialize(msg='No input')
14
+ def initialize(msg = 'No input', topic = 'Exited:')
16
15
  Doing.logger.output_results
17
- Doing.logger.log_now(:warn, 'Exited:', 'Input empty')
16
+ Doing.logger.log_now(:warn, topic, msg)
18
17
  Process.exit 1
19
18
  end
20
19
  end
21
20
 
22
21
  class DoingStandardError < ::StandardError
23
- def initialize(msg='')
22
+ def initialize(msg = '')
24
23
  Doing.logger.output_results
25
24
 
26
25
  super
27
26
  end
28
27
  end
29
28
 
29
+ class WrongCommand < ::StandardError
30
+ def initialize(msg = 'wrong command', topic: 'Error:')
31
+ Doing.logger.warn(topic, msg)
32
+
33
+ super(msg)
34
+ end
35
+ end
36
+
30
37
  class DoingRuntimeError < ::RuntimeError
31
- def initialize(msg='')
38
+ def initialize(msg = 'Runtime Error', topic: 'Error:')
32
39
  Doing.logger.output_results
33
-
34
- super
40
+ Doing.logger.log_now(:error, topic, msg)
41
+ Process.exit 1
35
42
  end
36
43
  end
37
44
 
38
45
  class NoResults < ::StandardError
39
- def initialize(msg='No results')
46
+ def initialize(msg = 'No results', topic = 'Exited:')
40
47
  Doing.logger.output_results
48
+ Doing.logger.log_now(:warn, topic, msg)
41
49
  Process.exit 0
42
50
 
43
51
  end
44
52
  end
45
53
 
46
54
  class DoingNoTraceError < ::StandardError
47
- def initialize(msg = nil, level = nil)
55
+ def initialize(msg = nil, level = nil, topic = nil)
48
56
  level ||= :error
49
57
  Doing.logger.output_results
50
58
  if msg
51
- Doing.logger.log_now(level, msg)
59
+ Doing.logger.log_now(level, topic, msg)
52
60
  end
53
61
 
54
62
  Process.exit 1
@@ -58,7 +66,7 @@ module Doing
58
66
  class PluginException < ::StandardError
59
67
  attr_reader :plugin
60
68
 
61
- def initialize(msg = 'Plugin error', type: nil, plugin: nil)
69
+ def initialize(msg = 'Plugin error', type = nil, plugin = nil)
62
70
  @plugin = plugin || 'Unknown Plugin'
63
71
 
64
72
  type ||= 'Unknown'
@@ -73,8 +81,7 @@ module Doing
73
81
 
74
82
  msg = "(#{@type}: #{@plugin}) #{msg}"
75
83
 
76
- Doing.logger.error('Plugin Error:', msg)
77
- Doing.logger.output_results
84
+ Doing.logger.log_now(:error, 'Plugin:', msg)
78
85
  Process.exit 1
79
86
  end
80
87
  end
data/lib/doing/item.rb CHANGED
@@ -60,21 +60,22 @@ module Doing
60
60
  @title.scan(/(?<= |\A)@([^\s(]+)/).map {|tag| tag[0]}.sort.uniq
61
61
  end
62
62
 
63
- def tags?(tags, bool = :and)
63
+ def tags?(tags, bool = :and, negate: false)
64
64
  tags = split_tags(tags)
65
65
  bool = bool.normalize_bool
66
66
 
67
- case bool
68
- when :and
69
- all_tags?(tags)
70
- when :not
71
- no_tags?(tags)
72
- else
73
- any_tags?(tags)
74
- end
67
+ matches = case bool
68
+ when :and
69
+ all_tags?(tags)
70
+ when :not
71
+ no_tags?(tags)
72
+ else
73
+ any_tags?(tags)
74
+ end
75
+ negate ? !matches : matches
75
76
  end
76
77
 
77
- def search(search)
78
+ def search(search, negate: false)
78
79
  text = @title + @note.to_s
79
80
  pattern = case search.strip
80
81
  when %r{^/.*?/$}
@@ -88,7 +89,7 @@ module Doing
88
89
  end
89
90
  rx = Regexp.new(pattern, !case_sensitive)
90
91
 
91
- text =~ rx
92
+ negate ? text !~ rx : text =~ rx
92
93
  end
93
94
 
94
95
  def should_finish?
@@ -18,17 +18,17 @@ module Doing
18
18
  error: ::Logger::ERROR
19
19
  }.freeze
20
20
 
21
- COUNT_KEYS = [
22
- :added_tags,
23
- :removed_tags,
24
- :added,
25
- :updated,
26
- :deleted,
27
- :completed,
28
- :archived,
29
- :moved,
30
- :completed_archived,
31
- :skipped
21
+ COUNT_KEYS = %i[
22
+ added_tags
23
+ removed_tags
24
+ added
25
+ updated
26
+ deleted
27
+ completed
28
+ archived
29
+ moved
30
+ completed_archived
31
+ skipped
32
32
  ].freeze
33
33
 
34
34
  #
@@ -293,6 +293,22 @@ module Doing
293
293
  end
294
294
  end
295
295
 
296
+ def output_results
297
+ total_counters
298
+
299
+ results = @results.select { |msg| write_message?(msg[:level]) }.uniq
300
+
301
+ if @logdev == $stdout
302
+ $stdout.print results.map {|res| res[:message].uncolor }.join("\n")
303
+ else
304
+ results.each do |msg|
305
+ @logdev.puts color_message(msg[:level], msg[:message])
306
+ end
307
+ end
308
+ end
309
+
310
+ private
311
+
296
312
  def color_message(level, topic, message = nil, &block)
297
313
  colors = Doing::Color
298
314
  message = message(topic, message, &block)
@@ -324,19 +340,5 @@ module Doing
324
340
 
325
341
  "#{prefix} #{message.highlight_tags}#{colors.reset}"
326
342
  end
327
-
328
- def output_results
329
- total_counters
330
-
331
- results = @results.select { |msg| write_message?(msg[:level]) }.uniq
332
-
333
- if @logdev == $stdout
334
- $stdout.print results.map {|res| res[:message].uncolor }.join("\n")
335
- else
336
- results.each do |msg|
337
- @logdev.puts color_message(msg[:level], msg[:message])
338
- end
339
- end
340
- end
341
343
  end
342
344
  end
@@ -113,7 +113,7 @@ module Doing
113
113
  ##
114
114
  def list_plugins(options = {})
115
115
  separator = options[:column] ? "\n" : "\t"
116
- type = options[:type].nil? || options[:type] =~ /all/i ? 'all' : [valid_type(options[:type])]
116
+ type = options[:type].nil? || options[:type] =~ /all/i ? 'all' : valid_type(options[:type])
117
117
 
118
118
  case type
119
119
  when :import
@@ -56,7 +56,7 @@ module Doing
56
56
  end_date: end_date,
57
57
  title: title.strip, #+ " #{note}"
58
58
  note: note.instance_of?(Array) ? note.to_s : note,
59
- time: '%02d:%02d:%02d' % wwid.fmt_time(interval),
59
+ time: '%02d:%02d:%02d' % wwid.format_time(interval),
60
60
  tags: tags
61
61
  }
62
62
 
@@ -68,7 +68,7 @@ module Doing
68
68
  new_item = {
69
69
  'id' => index + 1,
70
70
  'content' => title.strip, #+ " #{note}"
71
- 'title' => title.strip + " (#{'%02d:%02d:%02d' % wwid.fmt_time(interval)})",
71
+ 'title' => title.strip + " (#{'%02d:%02d:%02d' % wwid.format_time(interval)})",
72
72
  'start' => i.date.strftime('%F %T'),
73
73
  'type' => 'box',
74
74
  'style' => 'color:#4c566b;background-color:#d8dee9;'
@@ -132,7 +132,7 @@ module Doing
132
132
  out += "#{output}\n"
133
133
  end
134
134
  # Doing.logger.debug('Template Export:', "#{items.count} items output to template #{opt[:template]}")
135
- out += wwid.tag_times(format: :text, sort_by_name: opt[:sort_tags], sort_order: opt[:tag_order]) if opt[:totals]
135
+ out += wwid.tag_times(format: wwid.config['timer_format'].to_sym, sort_by_name: opt[:sort_tags], sort_order: opt[:tag_order]) if opt[:totals]
136
136
  out
137
137
  end
138
138
 
@@ -64,9 +64,15 @@ module Doing
64
64
  new_items.push(new_entry)
65
65
  end
66
66
  total = new_items.count
67
+
68
+ new_items = wwid.filter_items(new_items, opt: options)
69
+ filtered = total - new_items.count
70
+ Doing.logger.debug('Skipped:' , %(#{filtered} items that didn't match filter criteria)) if filtered.positive?
71
+
67
72
  new_items = wwid.dedup(new_items, options[:no_overlap])
68
- dups = total - new_items.count
73
+ dups = filtered - new_items.count
69
74
  Doing.logger.info(%(Skipped #{dups} items with overlapping times)) if dups.positive?
75
+
70
76
  wwid.content[section][:items].concat(new_items)
71
77
  Doing.logger.info(%(Imported #{new_items.count} items to #{section}))
72
78
  end
@@ -40,13 +40,13 @@ module Doing
40
40
 
41
41
  new_items = read_doing_file(path)
42
42
 
43
- if options[:date_filter]
44
- new_items = wwid.filter_items(new_items, opt: { count: 0, date_filter: options[:date_filter] })
45
- end
43
+ total = new_items.count
46
44
 
47
- if options[:before] || options[:after]
48
- new_items = wwid.filter_items(new_items, opt: { count: 0, before: options[:before], after: options[:after] })
49
- end
45
+ options[:count] = 0
46
+ new_items = wwid.filter_items(new_items, opt: options)
47
+
48
+ skipped = total - new_items.count
49
+ Doing.logger.debug('Skipped:' , %(#{skipped} items that didn't match filter criteria)) if skipped.positive?
50
50
 
51
51
  imported = []
52
52
 
@@ -66,9 +66,15 @@ module Doing
66
66
  total = new_items.count
67
67
  skipped = data.count - total
68
68
  Doing.logger.debug('Skipped:' , %(#{skipped} items, invalid type or no time interval)) if skipped.positive?
69
+
70
+ new_items = wwid.filter_items(new_items, opt: options)
71
+ filtered = skipped - new_items.count
72
+ Doing.logger.debug('Skipped:' , %(#{filtered} items that didn't match filter criteria)) if filtered.positive?
73
+
69
74
  new_items = wwid.dedup(new_items, options[:no_overlap])
70
- dups = total - new_items.count
75
+ dups = filtered - new_items.count
71
76
  Doing.logger.debug('Skipped:' , %(#{dups} items with overlapping times)) if dups.positive?
77
+
72
78
  wwid.content[section][:items].concat(new_items)
73
79
  Doing.logger.info('Imported:', %(#{new_items.count} items to #{section}))
74
80
  end
data/lib/doing/string.rb CHANGED
@@ -209,11 +209,12 @@ module Doing
209
209
  title
210
210
  end
211
211
 
212
- def tag!(tag, value: nil, remove: false, rename_to: nil, regex: false)
213
- replace tag(tag, value: value, remove: remove, rename_to: rename_to, regex: regex)
212
+ def tag!(tag, value: nil, remove: false, rename_to: nil, regex: false, single: false)
213
+ replace tag(tag, value: value, remove: remove, rename_to: rename_to, regex: regex, single: single)
214
214
  end
215
215
 
216
- def tag(tag, value: nil, remove: false, rename_to: nil, regex: false)
216
+ def tag(tag, value: nil, remove: false, rename_to: nil, regex: false, single: false)
217
+ log_level = single ? :info : :debug
217
218
  title = dup
218
219
  title.chomp!
219
220
  tag = tag.sub(/^@?/, '')
@@ -241,10 +242,10 @@ module Doing
241
242
  if rename_to
242
243
  f = "@#{tag}".cyan
243
244
  t = "@#{rename_to}".cyan
244
- Doing.logger.debug('Tag:', %(renamed #{f} to #{t} in "#{title}"))
245
+ Doing.logger.write(log_level, 'Tag:', %(renamed #{f} to #{t} in "#{title}"))
245
246
  else
246
247
  f = "@#{tag}".cyan
247
- Doing.logger.debug('Tag:', %(removed #{f} from "#{title}"))
248
+ Doing.logger.write(log_level, 'Tag:', %(removed #{f} from "#{title}"))
248
249
  end
249
250
  else
250
251
  Doing.logger.debug('Skipped:', "not tagged #{"@#{tag}".cyan}")
@@ -255,14 +256,15 @@ module Doing
255
256
  else
256
257
  add = tag
257
258
  add += "(#{value})" unless value.nil?
259
+ title.chomp!
258
260
  title += " @#{add}"
259
261
 
260
262
  title.dedup_tags!
261
263
  title.chomp!
262
- # Doing.logger.debug('Added tag:', %(#{('@' + tag).cyan} to "#{title}"))
264
+ Doing.logger.write(log_level, 'Tag:', %(added #{('@' + tag).cyan} to "#{title}"))
263
265
  end
264
266
 
265
- title
267
+ title.gsub(/ +/, ' ')
266
268
  end
267
269
 
268
270
  ##
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '2.0.3.pre'
2
+ VERSION = '2.0.8.pre'
3
3
  end