doing 2.0.22 → 2.1.0pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/.yardoc/checksums +18 -15
  3. data/.yardoc/object_types +0 -0
  4. data/.yardoc/objects/root.dat +0 -0
  5. data/CHANGELOG.md +36 -1
  6. data/Gemfile.lock +8 -1
  7. data/README.md +7 -1
  8. data/Rakefile +23 -4
  9. data/bin/doing +323 -173
  10. data/doc/Array.html +354 -1
  11. data/doc/Doing/Color.html +104 -92
  12. data/doc/Doing/Completion.html +216 -0
  13. data/doc/Doing/Configuration.html +340 -5
  14. data/doc/Doing/Content.html +229 -0
  15. data/doc/Doing/Errors/DoingNoTraceError.html +1 -1
  16. data/doc/Doing/Errors/DoingRuntimeError.html +1 -1
  17. data/doc/Doing/Errors/DoingStandardError.html +1 -1
  18. data/doc/Doing/Errors/EmptyInput.html +1 -1
  19. data/doc/Doing/Errors/NoResults.html +1 -1
  20. data/doc/Doing/Errors/PluginException.html +1 -1
  21. data/doc/Doing/Errors/UserCancelled.html +1 -1
  22. data/doc/Doing/Errors/WrongCommand.html +1 -1
  23. data/doc/Doing/Errors.html +1 -1
  24. data/doc/Doing/Hooks.html +1 -1
  25. data/doc/Doing/Item.html +337 -49
  26. data/doc/Doing/Items.html +444 -35
  27. data/doc/Doing/LogAdapter.html +139 -51
  28. data/doc/Doing/Note.html +253 -22
  29. data/doc/Doing/Pager.html +74 -36
  30. data/doc/Doing/Plugins.html +1 -1
  31. data/doc/Doing/Prompt.html +674 -0
  32. data/doc/Doing/Section.html +354 -0
  33. data/doc/Doing/Util.html +57 -1
  34. data/doc/Doing/WWID.html +477 -670
  35. data/doc/Doing/WWIDFile.html +398 -0
  36. data/doc/Doing.html +5 -5
  37. data/doc/GLI/Commands/MarkdownDocumentListener.html +1 -1
  38. data/doc/GLI/Commands.html +1 -1
  39. data/doc/GLI.html +1 -1
  40. data/doc/Hash.html +97 -1
  41. data/doc/Status.html +37 -3
  42. data/doc/String.html +599 -23
  43. data/doc/Symbol.html +3 -3
  44. data/doc/Time.html +1 -1
  45. data/doc/_index.html +22 -1
  46. data/doc/class_list.html +1 -1
  47. data/doc/file.README.html +8 -2
  48. data/doc/index.html +8 -2
  49. data/doc/method_list.html +453 -173
  50. data/doc/top-level-namespace.html +1 -1
  51. data/doing.gemspec +3 -0
  52. data/doing.rdoc +79 -27
  53. data/example_plugin.rb +5 -5
  54. data/lib/completion/_doing.zsh +42 -42
  55. data/lib/completion/doing.bash +10 -10
  56. data/lib/completion/doing.fish +1 -280
  57. data/lib/doing/array.rb +36 -0
  58. data/lib/doing/colors.rb +70 -66
  59. data/lib/doing/completion/bash_completion.rb +1 -2
  60. data/lib/doing/completion/fish_completion.rb +1 -1
  61. data/lib/doing/completion/zsh_completion.rb +1 -1
  62. data/lib/doing/completion.rb +6 -0
  63. data/lib/doing/configuration.rb +134 -23
  64. data/lib/doing/hash.rb +37 -0
  65. data/lib/doing/item.rb +77 -12
  66. data/lib/doing/items.rb +125 -0
  67. data/lib/doing/log_adapter.rb +58 -4
  68. data/lib/doing/note.rb +53 -1
  69. data/lib/doing/pager.rb +49 -38
  70. data/lib/doing/plugins/export/markdown_export.rb +4 -4
  71. data/lib/doing/plugins/export/template_export.rb +2 -2
  72. data/lib/doing/plugins/import/calendar_import.rb +4 -4
  73. data/lib/doing/plugins/import/doing_import.rb +5 -7
  74. data/lib/doing/plugins/import/timing_import.rb +3 -3
  75. data/lib/doing/prompt.rb +206 -0
  76. data/lib/doing/section.rb +30 -0
  77. data/lib/doing/string.rb +123 -35
  78. data/lib/doing/util.rb +14 -6
  79. data/lib/doing/version.rb +1 -1
  80. data/lib/doing/wwid.rb +307 -614
  81. data/lib/doing.rb +6 -2
  82. data/lib/examples/plugins/capture_thing_import.rb +162 -0
  83. data/rdoc_to_mmd.rb +14 -8
  84. data/scripts/generate_bash_completions.rb +1 -1
  85. data/scripts/generate_fish_completions.rb +1 -1
  86. data/scripts/generate_zsh_completions.rb +1 -1
  87. metadata +73 -5
  88. data/lib/doing/wwidfile.rb +0 -117
@@ -91,288 +91,9 @@ complete -xc doing -n '__fish_doing_needs_command' -a 'tag' -d Add\ tag\(s\)\ to
91
91
  complete -xc doing -n '__fish_doing_needs_command' -a 'template' -d Output\ HTML
92
92
  complete -xc doing -n '__fish_doing_needs_command' -a 'test' -d Test\ Stuff
93
93
  complete -xc doing -n '__fish_doing_needs_command' -a 'today' -d List\ entries\ from\ today
94
- complete -xc doing -n '__fish_doing_needs_command' -a 'undo' -d Undo\ the\ last\ change\ to\ the\ doing_file
94
+ complete -xc doing -n '__fish_doing_needs_command' -a 'undo' -d Undo\ the\ last\ change\ to\ the\ Doing\ file
95
95
  complete -xc doing -n '__fish_doing_needs_command' -a 'view' -d Display\ a\ user-created\ view
96
96
  complete -xc doing -n '__fish_doing_needs_command' -a 'views' -d List\ available\ custom\ views
97
97
  complete -xc doing -n '__fish_doing_needs_command' -a 'wiki' -d Output\ a\ tag\ wiki
98
98
  complete -xc doing -n '__fish_doing_needs_command' -a 'yesterday' -d List\ entries\ from\ yesterday
99
- complete -c doing -l bool -f -r -n '__fish_doing_using_command again resume' -d Boolean\ used\ to\ combine\ multiple\ tags
100
- complete -c doing -l case -f -r -n '__fish_doing_using_command again resume' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
101
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command again resume' -d Edit\ duplicated\ entry\ with\ vim\ before\ adding
102
- 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
103
- complete -c doing -l in -f -r -n '__fish_doing_using_command again resume' -d Add\ new\ entry\ to\ section
104
- complete -c doing -l note -s n -f -r -n '__fish_doing_using_command again resume' -d Note
105
- complete -c doing -l not -f -n '__fish_doing_using_command again resume' -d Resume\ items\ that\ \*don\'t\*\ match\ search/tag\ filters
106
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command again resume' -d Get\ last\ entry\ from\ a\ specific\ section
107
- complete -c doing -l search -f -r -n '__fish_doing_using_command again resume' -d Repeat\ last\ entry\ matching\ search
108
- complete -c doing -l tag -f -r -n '__fish_doing_using_command again resume' -d Repeat\ last\ entry\ matching\ tags
109
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command again resume' -d Force\ exact\ search\ string\ matching
110
- complete -c doing -l before -f -r -n '__fish_doing_using_command archive move' -d Archive\ entries\ older\ than\ date
111
- complete -c doing -l bool -f -r -n '__fish_doing_using_command archive move' -d Tag\ boolean
112
- complete -c doing -l case -f -r -n '__fish_doing_using_command archive move' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
113
- complete -c doing -l keep -s k -f -r -n '__fish_doing_using_command archive move' -d How\ many\ items\ to\ keep
114
- complete -c doing -l label -f -n '__fish_doing_using_command archive move' -d Label\ moved\ items\ with\ @from\(SECTION_NAME\)
115
- complete -c doing -l not -f -n '__fish_doing_using_command archive move' -d Show\ items\ that\ \*don\'t\*\ match\ search\ string
116
- complete -c doing -l search -f -r -n '__fish_doing_using_command archive move' -d Search\ filter
117
- complete -c doing -l to -s t -f -r -n '__fish_doing_using_command archive move' -d Move\ entries\ to
118
- complete -c doing -l tag -f -r -n '__fish_doing_using_command archive move' -d Tag\ filter
119
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command archive move' -d Force\ exact\ search\ string\ matching
120
- complete -c doing -l bool -f -r -n '__fish_doing_using_command autotag' -d Boolean
121
- complete -c doing -l count -s c -f -r -n '__fish_doing_using_command autotag' -d How\ many\ recent\ entries\ to\ autotag
122
- 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
123
- 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
124
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command autotag' -d Section
125
- complete -c doing -l search -f -r -n '__fish_doing_using_command autotag' -d Autotag\ entries\ matching\ search\ filter
126
- complete -c doing -l tag -f -r -n '__fish_doing_using_command autotag' -d Autotag\ the\ last\ X\ entries\ containing\ TAG
127
- complete -c doing -l unfinished -s u -f -n '__fish_doing_using_command autotag' -d Autotag\ last\ entry
128
- complete -c doing -l archive -s a -f -n '__fish_doing_using_command cancel' -d Archive\ entries
129
- complete -c doing -l bool -f -r -n '__fish_doing_using_command cancel' -d Boolean
130
- complete -c doing -l case -f -r -n '__fish_doing_using_command cancel' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
131
- 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
132
- complete -c doing -l not -f -n '__fish_doing_using_command cancel' -d Finish\ items\ that\ \*don\'t\*\ match\ search/tag\ filters
133
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command cancel' -d Section
134
- complete -c doing -l search -f -r -n '__fish_doing_using_command cancel' -d Cancel\ the\ last\ X\ entries\ matching\ search\ filter
135
- complete -c doing -l tag -f -r -n '__fish_doing_using_command cancel' -d Cancel\ the\ last\ X\ entries\ containing\ TAG
136
- complete -c doing -l unfinished -s u -f -n '__fish_doing_using_command cancel' -d Cancel\ last\ entry
137
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command cancel' -d Force\ exact\ search\ string\ matching
138
- complete -c doing -l file -s f -f -r -n '__fish_doing_using_command completion' -d File\ to\ write\ output\ to
139
- complete -c doing -l type -s t -f -r -n '__fish_doing_using_command completion' -d Shell\ to\ generate\ for
140
- complete -c doing -F -n '__fish_doing_using_command config'
141
- complete -c doing -l dump -s d -f -n '__fish_doing_using_command config' -d Show\ a\ config\ key\ value\ based\ on\ arguments
142
- complete -c doing -l editor -s e -f -r -n '__fish_doing_using_command config' -d Editor\ to\ use
143
- complete -c doing -l output -s o -f -r -n '__fish_doing_using_command config' -d Format\ for\ --dump
144
- complete -c doing -l update -s u -f -n '__fish_doing_using_command config' -d Update\ config\ file\ with\ missing\ configuration\ options
145
- complete -c doing -l archive -s a -f -n '__fish_doing_using_command done did' -d Immediately\ archive\ the\ entry
146
- complete -c doing -l at -f -r -n '__fish_doing_using_command done did' -d Set\ finish\ date\ to\ specific\ date/time
147
- 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\]
148
- complete -c doing -l date -f -n '__fish_doing_using_command done did' -d Include\ date
149
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command done did' -d Edit\ entry\ with\ vim
150
- complete -c doing -l note -s n -f -r -n '__fish_doing_using_command done did' -d Include\ a\ note
151
- complete -c doing -l remove -s r -f -n '__fish_doing_using_command done did' -d Remove\ @done\ tag
152
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command done did' -d Section
153
- 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
154
- complete -c doing -l unfinished -s u -f -n '__fish_doing_using_command done did' -d Finish\ last\ entry\ not\ already\ marked\ @done
155
- complete -c doing -l archive -s a -f -n '__fish_doing_using_command finish' -d Archive\ entries
156
- complete -c doing -l at -f -r -n '__fish_doing_using_command finish' -d Set\ finish\ date\ to\ specific\ date/time
157
- complete -c doing -l auto -f -n '__fish_doing_using_command finish' -d Auto-generate\ finish\ dates\ from\ next\ entry\'s\ start\ time
158
- 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\]
159
- complete -c doing -l bool -f -r -n '__fish_doing_using_command finish' -d Boolean
160
- complete -c doing -l case -f -r -n '__fish_doing_using_command finish' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
161
- complete -c doing -l date -f -n '__fish_doing_using_command finish' -d Include\ date
162
- 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
163
- complete -c doing -l not -f -n '__fish_doing_using_command finish' -d Finish\ items\ that\ \*don\'t\*\ match\ search/tag\ filters
164
- complete -c doing -l remove -s r -f -n '__fish_doing_using_command finish' -d Remove\ done\ tag
165
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command finish' -d Section
166
- complete -c doing -l search -f -r -n '__fish_doing_using_command finish' -d Finish\ the\ last\ X\ entries\ matching\ search\ filter
167
- 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\]
168
- complete -c doing -l tag -f -r -n '__fish_doing_using_command finish' -d Finish\ the\ last\ X\ entries\ containing\ TAG
169
- complete -c doing -l unfinished -s u -f -n '__fish_doing_using_command finish' -d Finish\ last\ entry
170
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command finish' -d Force\ exact\ search\ string\ matching
171
- complete -c doing -l after -f -r -n '__fish_doing_using_command grep search' -d Constrain\ search\ to\ entries\ newer\ than\ date
172
- complete -c doing -l before -f -r -n '__fish_doing_using_command grep search' -d Constrain\ search\ to\ entries\ older\ than\ date
173
- complete -c doing -l case -f -r -n '__fish_doing_using_command grep search' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
174
- complete -c doing -l interactive -s i -f -n '__fish_doing_using_command grep search' -d Display\ an\ interactive\ menu\ of\ results\ to\ perform\ further\ operations
175
- complete -c doing -l not -f -n '__fish_doing_using_command grep search' -d Show\ items\ that\ \*don\'t\*\ match\ search\ string
176
- complete -c doing -l output -s o -f -r -n '__fish_doing_using_command grep search' -d Output\ to\ export\ format
177
- complete -c doing -l only_timed -f -n '__fish_doing_using_command grep search' -d Only\ show\ items\ with\ recorded\ time\ intervals
178
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command grep search' -d Section
179
- complete -c doing -l times -s t -f -n '__fish_doing_using_command grep search' -d Show\ time\ intervals\ on\ @done\ tasks
180
- complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command grep search' -d Sort\ tags\ by
181
- complete -c doing -l totals -f -n '__fish_doing_using_command grep search' -d Show\ intervals\ with\ totals\ at\ the\ end\ of\ output
182
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command grep search' -d Force\ exact\ string\ matching
183
99
  complete -c doing -F -n '__fish_doing_using_command import'
184
- complete -c doing -l after -f -r -n '__fish_doing_using_command import' -d Import\ entries\ newer\ than\ date
185
- complete -c doing -l autotag -f -n '__fish_doing_using_command import' -d Autotag\ entries
186
- complete -c doing -l before -f -r -n '__fish_doing_using_command import' -d Import\ entries\ older\ than\ date
187
- complete -c doing -l case -f -r -n '__fish_doing_using_command import' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
188
- complete -c doing -l from -s f -f -r -n '__fish_doing_using_command import' -d Date\ range\ to\ import
189
- complete -c doing -l not -f -n '__fish_doing_using_command import' -d Import\ items\ that\ \*don\'t\*\ match\ search/tag/date\ filters
190
- complete -c doing -l only_timed -f -n '__fish_doing_using_command import' -d Only\ import\ items\ with\ recorded\ time\ intervals
191
- complete -c doing -l overlap -f -n '__fish_doing_using_command import' -d Allow\ entries\ that\ overlap\ existing\ times
192
- complete -c doing -l prefix -f -r -n '__fish_doing_using_command import' -d Prefix\ entries\ with
193
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command import' -d Target\ section
194
- complete -c doing -l search -f -r -n '__fish_doing_using_command import' -d Only\ import\ items\ matching\ search
195
- complete -c doing -l tag -f -r -n '__fish_doing_using_command import' -d Tag\ all\ imported\ entries
196
- complete -c doing -l type -f -r -n '__fish_doing_using_command import' -d Import\ type
197
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command import' -d Force\ exact\ search\ string\ matching
198
- complete -c doing -l bool -f -r -n '__fish_doing_using_command last' -d Tag\ boolean
199
- complete -c doing -l case -f -r -n '__fish_doing_using_command last' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
200
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command last' -d Edit\ entry\ with\ vim
201
- complete -c doing -l not -f -n '__fish_doing_using_command last' -d Show\ items\ that\ \*don\'t\*\ match\ search\ string\ or\ tag\ filter
202
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command last' -d Specify\ a\ section
203
- complete -c doing -l search -f -r -n '__fish_doing_using_command last' -d Search\ filter
204
- complete -c doing -l tag -f -r -n '__fish_doing_using_command last' -d Tag\ filter
205
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command last' -d Force\ exact\ search\ string\ matching
206
- 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\]
207
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command later' -d Edit\ entry\ with\ vim
208
- complete -c doing -l note -s n -f -r -n '__fish_doing_using_command later' -d Note
209
- complete -c doing -l bool -f -r -n '__fish_doing_using_command mark flag' -d Boolean
210
- complete -c doing -l count -s c -f -r -n '__fish_doing_using_command mark flag' -d How\ many\ recent\ entries\ to\ tag
211
- complete -c doing -l case -f -r -n '__fish_doing_using_command mark flag' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
212
- complete -c doing -l date -s d -f -n '__fish_doing_using_command mark flag' -d Include\ current\ date/time\ with\ tag
213
- 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
214
- 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
215
- complete -c doing -l not -f -n '__fish_doing_using_command mark flag' -d Flag\ items\ that\ \*don\'t\*\ match\ search/tag/date\ filters
216
- complete -c doing -l remove -s r -f -n '__fish_doing_using_command mark flag' -d Remove\ flag
217
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command mark flag' -d Section
218
- complete -c doing -l search -f -r -n '__fish_doing_using_command mark flag' -d Flag\ the\ last\ entry\ matching\ search\ filter
219
- complete -c doing -l tag -f -r -n '__fish_doing_using_command mark flag' -d Flag\ the\ last\ entry\ containing\ TAG
220
- complete -c doing -l unfinished -s u -f -n '__fish_doing_using_command mark flag' -d Flag\ last\ entry
221
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command mark flag' -d Force\ exact\ search\ string\ matching
222
- complete -c doing -l archive -s a -f -n '__fish_doing_using_command meanwhile' -d Archive\ previous\ @meanwhile\ entry
223
- 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\]
224
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command meanwhile' -d Edit\ entry\ with\ vim
225
- complete -c doing -l note -s n -f -r -n '__fish_doing_using_command meanwhile' -d Note
226
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command meanwhile' -d Section
227
- complete -c doing -l bool -f -r -n '__fish_doing_using_command note' -d Boolean
228
- complete -c doing -l case -f -r -n '__fish_doing_using_command note' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
229
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command note' -d Edit\ entry\ with\ vim
230
- 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
231
- complete -c doing -l not -f -n '__fish_doing_using_command note' -d Add\ note\ to\ item\ that\ \*doesn\'t\*\ match\ search/tag\ filters
232
- complete -c doing -l remove -s r -f -n '__fish_doing_using_command note' -d Replace/Remove\ last\ entry\'s\ note
233
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command note' -d Section
234
- complete -c doing -l search -f -r -n '__fish_doing_using_command note' -d Add/remove\ note\ from\ last\ entry\ matching\ search\ filter
235
- complete -c doing -l tag -f -r -n '__fish_doing_using_command note' -d Add/remove\ note\ from\ last\ entry\ matching\ tag
236
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command note' -d Force\ exact\ search\ string\ matching
237
- 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\]
238
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command now next' -d Edit\ entry\ with\ vim
239
- complete -c doing -l finish_last -s f -f -n '__fish_doing_using_command now next' -d Timed\ entry
240
- complete -c doing -l note -s n -f -r -n '__fish_doing_using_command now next' -d Include\ a\ note
241
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command now next' -d Section
242
- complete -c doing -l output -s o -f -r -n '__fish_doing_using_command on' -d Output\ to\ export\ format
243
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command on' -d Section
244
- complete -c doing -l times -s t -f -n '__fish_doing_using_command on' -d Show\ time\ intervals\ on\ @done\ tasks
245
- complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command on' -d Sort\ tags\ by
246
- complete -c doing -l totals -f -n '__fish_doing_using_command on' -d Show\ time\ totals\ at\ the\ end\ of\ output
247
- complete -c doing -l app -s a -f -r -n '__fish_doing_using_command open' -d Open\ with\ app\ name
248
- complete -c doing -l bundle_id -s b -f -r -n '__fish_doing_using_command open' -d Open\ with\ app\ bundle\ id
249
- complete -c doing -l column -s c -f -n '__fish_doing_using_command plugins' -d List\ in\ single\ column\ for\ completion
250
- complete -c doing -l type -s t -f -r -n '__fish_doing_using_command plugins' -d List\ plugins\ of\ type
251
- 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
252
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command recent' -d Section
253
- complete -c doing -l times -s t -f -n '__fish_doing_using_command recent' -d Show\ time\ intervals\ on\ @done\ tasks
254
- complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command recent' -d Sort\ tags\ by
255
- complete -c doing -l totals -f -n '__fish_doing_using_command recent' -d Show\ intervals\ with\ totals\ at\ the\ end\ of\ output
256
- complete -c doing -l bool -f -r -n '__fish_doing_using_command reset begin' -d Boolean
257
- complete -c doing -l case -f -r -n '__fish_doing_using_command reset begin' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
258
- complete -c doing -l interactive -s i -f -n '__fish_doing_using_command reset begin' -d Select\ from\ a\ menu\ of\ matching\ entries
259
- complete -c doing -l not -f -n '__fish_doing_using_command reset begin' -d Reset\ items\ that\ \*don\'t\*\ match\ search/tag\ filters
260
- complete -c doing -l resume -s r -f -n '__fish_doing_using_command reset begin' -d Resume\ entry
261
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command reset begin' -d Limit\ search\ to\ section
262
- complete -c doing -l search -f -r -n '__fish_doing_using_command reset begin' -d Reset\ last\ entry\ matching\ search\ filter
263
- complete -c doing -l tag -f -r -n '__fish_doing_using_command reset begin' -d Reset\ last\ entry\ matching\ tag
264
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command reset begin' -d Force\ exact\ search\ string\ matching
265
- complete -c doing -l before -f -r -n '__fish_doing_using_command rotate' -d Rotate\ entries\ older\ than\ date
266
- complete -c doing -l bool -f -r -n '__fish_doing_using_command rotate' -d Tag\ boolean
267
- complete -c doing -l case -f -r -n '__fish_doing_using_command rotate' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
268
- complete -c doing -l keep -s k -f -r -n '__fish_doing_using_command rotate' -d How\ many\ items\ to\ keep\ in\ each\ section
269
- complete -c doing -l not -f -n '__fish_doing_using_command rotate' -d Rotate\ items\ that\ \*don\'t\*\ match\ search\ string\ or\ tag\ filter
270
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command rotate' -d Section\ to\ rotate
271
- complete -c doing -l search -f -r -n '__fish_doing_using_command rotate' -d Search\ filter
272
- complete -c doing -l tag -f -r -n '__fish_doing_using_command rotate' -d Tag\ filter
273
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command rotate' -d Force\ exact\ search\ string\ matching
274
- complete -c doing -l column -s c -f -n '__fish_doing_using_command sections' -d List\ in\ single\ column
275
- complete -c doing -l archive -s a -f -n '__fish_doing_using_command select' -d Archive\ selected\ items
276
- 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
277
- complete -c doing -l cancel -s c -f -n '__fish_doing_using_command select' -d Cancel\ selected\ items
278
- complete -c doing -l case -f -r -n '__fish_doing_using_command select' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
279
- complete -c doing -l delete -s d -f -n '__fish_doing_using_command select' -d Delete\ selected\ items
280
- complete -c doing -l editor -s e -f -n '__fish_doing_using_command select' -d Edit\ selected\ item\(s\)
281
- complete -c doing -l finish -s f -f -n '__fish_doing_using_command select' -d Add\ @done\ with\ current\ time\ to\ selected\ item\(s\)
282
- complete -c doing -l flag -f -n '__fish_doing_using_command select' -d Add\ flag\ to\ selected\ item\(s\)
283
- complete -c doing -l force -f -n '__fish_doing_using_command select' -d Perform\ action\ without\ confirmation
284
- complete -c doing -l move -s m -f -r -n '__fish_doing_using_command select' -d Move\ selected\ items\ to\ section
285
- complete -c doing -l menu -f -n '__fish_doing_using_command select' -d Use\ --no-menu\ to\ skip\ the\ interactive\ menu
286
- complete -c doing -l not -f -n '__fish_doing_using_command select' -d Select\ items\ that\ \*don\'t\*\ match\ search/tag\ filters
287
- complete -c doing -l output -s o -f -r -n '__fish_doing_using_command select' -d Output\ entries\ to\ format
288
- complete -c doing -l search -f -r -n '__fish_doing_using_command select' -d Initial\ search\ query\ for\ filtering
289
- complete -c doing -l remove -s r -f -n '__fish_doing_using_command select' -d Reverse\ -c
290
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command select' -d Select\ from\ a\ specific\ section
291
- complete -c doing -l save_to -f -r -n '__fish_doing_using_command select' -d Save\ selected\ entries\ to\ file\ using\ --output\ format
292
- complete -c doing -l tag -s t -f -r -n '__fish_doing_using_command select' -d Tag\ selected\ entries
293
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command select' -d Force\ exact\ search\ string\ matching
294
- complete -c doing -l age -s a -f -r -n '__fish_doing_using_command show' -d Age
295
- complete -c doing -l after -f -r -n '__fish_doing_using_command show' -d View\ entries\ newer\ than\ date
296
- complete -c doing -l bool -s b -f -r -n '__fish_doing_using_command show' -d Tag\ boolean
297
- complete -c doing -l before -f -r -n '__fish_doing_using_command show' -d View\ entries\ older\ than\ date
298
- complete -c doing -l count -s c -f -r -n '__fish_doing_using_command show' -d Max\ count\ to\ show
299
- complete -c doing -l case -f -r -n '__fish_doing_using_command show' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
300
- complete -c doing -l from -s f -f -r -n '__fish_doing_using_command show' -d Date\ range\ to\ show
301
- 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
302
- complete -c doing -l not -f -n '__fish_doing_using_command show' -d Show\ items\ that\ \*don\'t\*\ match\ search/tag/date\ filters
303
- complete -c doing -l output -s o -f -r -n '__fish_doing_using_command show' -d Output\ to\ export\ format
304
- complete -c doing -l only_timed -f -n '__fish_doing_using_command show' -d Only\ show\ items\ with\ recorded\ time\ intervals
305
- complete -c doing -l sort -s s -f -r -n '__fish_doing_using_command show' -d Sort\ order
306
- complete -c doing -l search -f -r -n '__fish_doing_using_command show' -d Search\ filter
307
- complete -c doing -l times -s t -f -n '__fish_doing_using_command show' -d Show\ time\ intervals\ on\ @done\ tasks
308
- complete -c doing -l tag -f -r -n '__fish_doing_using_command show' -d Tag\ filter
309
- complete -c doing -l tag_order -f -r -n '__fish_doing_using_command show' -d Tag\ sort\ direction
310
- complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command show' -d Sort\ tags\ by
311
- complete -c doing -l totals -f -n '__fish_doing_using_command show' -d Show\ intervals\ with\ totals\ at\ the\ end\ of\ output
312
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command show' -d Force\ exact\ search\ string\ matching
313
- complete -c doing -l output -s o -f -r -n '__fish_doing_using_command since' -d Output\ to\ export\ format
314
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command since' -d Section
315
- complete -c doing -l times -s t -f -n '__fish_doing_using_command since' -d Show\ time\ intervals\ on\ @done\ tasks
316
- complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command since' -d Sort\ tags\ by
317
- complete -c doing -l totals -f -n '__fish_doing_using_command since' -d Show\ time\ totals\ at\ the\ end\ of\ output
318
- complete -c doing -l autotag -s a -f -n '__fish_doing_using_command tag' -d Autotag\ entries\ based\ on\ autotag\ configuration\ in\ \~/
319
- complete -c doing -l bool -f -r -n '__fish_doing_using_command tag' -d Boolean
320
- complete -c doing -l count -s c -f -r -n '__fish_doing_using_command tag' -d How\ many\ recent\ entries\ to\ tag
321
- complete -c doing -l case -f -r -n '__fish_doing_using_command tag' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
322
- complete -c doing -l date -s d -f -n '__fish_doing_using_command tag' -d Include\ current\ date/time\ with\ tag
323
- 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
324
- 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
325
- complete -c doing -l not -f -n '__fish_doing_using_command tag' -d Tag\ items\ that\ \*don\'t\*\ match\ search/tag\ filters
326
- complete -c doing -l remove -s r -f -n '__fish_doing_using_command tag' -d Remove\ given\ tag\(s\)
327
- complete -c doing -l regex -f -n '__fish_doing_using_command tag' -d Interpret\ tag\ string\ as\ regular\ expression
328
- complete -c doing -l rename -f -r -n '__fish_doing_using_command tag' -d Replace\ existing\ tag\ with\ tag\ argument
329
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command tag' -d Section
330
- complete -c doing -l search -f -r -n '__fish_doing_using_command tag' -d Tag\ entries\ matching\ search\ filter
331
- complete -c doing -l tag -f -r -n '__fish_doing_using_command tag' -d Tag\ the\ last\ X\ entries\ containing\ TAG
332
- complete -c doing -l unfinished -s u -f -n '__fish_doing_using_command tag' -d Tag\ last\ entry
333
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command tag' -d Force\ exact\ search\ string\ matching
334
- complete -c doing -l list -s l -f -n '__fish_doing_using_command template' -d List\ all\ available\ templates
335
- complete -c doing -l after -f -r -n '__fish_doing_using_command today' -d View\ entries\ after\ specified\ time
336
- complete -c doing -l before -f -r -n '__fish_doing_using_command today' -d View\ entries\ before\ specified\ time
337
- complete -c doing -l output -s o -f -r -n '__fish_doing_using_command today' -d Output\ to\ export\ format
338
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command today' -d Specify\ a\ section
339
- complete -c doing -l times -s t -f -n '__fish_doing_using_command today' -d Show\ time\ intervals\ on\ @done\ tasks
340
- complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command today' -d Sort\ tags\ by
341
- complete -c doing -l totals -f -n '__fish_doing_using_command today' -d Show\ time\ totals\ at\ the\ end\ of\ output
342
- complete -c doing -l file -s f -f -r -n '__fish_doing_using_command undo' -d Specify\ alternate\ doing\ file
343
- complete -c doing -l after -f -r -n '__fish_doing_using_command view' -d View\ entries\ newer\ than\ date
344
- complete -c doing -l bool -s b -f -r -n '__fish_doing_using_command view' -d Tag\ boolean
345
- complete -c doing -l before -f -r -n '__fish_doing_using_command view' -d View\ entries\ older\ than\ date
346
- complete -c doing -l count -s c -f -r -n '__fish_doing_using_command view' -d Count\ to\ display
347
- complete -c doing -l case -f -r -n '__fish_doing_using_command view' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
348
- complete -c doing -l color -f -n '__fish_doing_using_command view' -d Include\ colors\ in\ output
349
- 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
350
- complete -c doing -l not -f -n '__fish_doing_using_command view' -d Show\ items\ that\ \*don\'t\*\ match\ search\ string
351
- complete -c doing -l output -s o -f -r -n '__fish_doing_using_command view' -d Output\ to\ export\ format
352
- complete -c doing -l only_timed -f -n '__fish_doing_using_command view' -d Only\ show\ items\ with\ recorded\ time\ intervals
353
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command view' -d Section
354
- complete -c doing -l search -f -r -n '__fish_doing_using_command view' -d Search\ filter
355
- complete -c doing -l times -s t -f -n '__fish_doing_using_command view' -d Show\ time\ intervals\ on\ @done\ tasks
356
- complete -c doing -l tag -f -r -n '__fish_doing_using_command view' -d Tag\ filter
357
- complete -c doing -l tag_order -f -r -n '__fish_doing_using_command view' -d Tag\ sort\ direction
358
- complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command view' -d Sort\ tags\ by
359
- complete -c doing -l totals -f -n '__fish_doing_using_command view' -d Show\ intervals\ with\ totals\ at\ the\ end\ of\ output
360
- complete -c doing -l exact -s x -f -n '__fish_doing_using_command view' -d Force\ exact\ search\ string\ matching
361
- complete -c doing -l column -s c -f -n '__fish_doing_using_command views' -d List\ in\ single\ column
362
- complete -c doing -l after -f -r -n '__fish_doing_using_command wiki' -d Include\ entries\ newer\ than\ date
363
- complete -c doing -l bool -s b -f -r -n '__fish_doing_using_command wiki' -d Tag\ boolean
364
- complete -c doing -l before -f -r -n '__fish_doing_using_command wiki' -d Include\ entries\ older\ than\ date
365
- complete -c doing -l from -s f -f -r -n '__fish_doing_using_command wiki' -d Date\ range\ to\ include
366
- complete -c doing -l only_timed -f -n '__fish_doing_using_command wiki' -d Only\ show\ items\ with\ recorded\ time\ intervals
367
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command wiki' -d Section\ to\ rotate
368
- complete -c doing -l search -f -r -n '__fish_doing_using_command wiki' -d Search\ filter
369
- complete -c doing -l tag -f -r -n '__fish_doing_using_command wiki' -d Tag\ filter
370
- complete -c doing -l after -f -r -n '__fish_doing_using_command yesterday' -d View\ entries\ after\ specified\ time
371
- complete -c doing -l before -f -r -n '__fish_doing_using_command yesterday' -d View\ entries\ before\ specified\ time
372
- complete -c doing -l output -s o -f -r -n '__fish_doing_using_command yesterday' -d Output\ to\ export\ format
373
- complete -c doing -l section -s s -f -r -n '__fish_doing_using_command yesterday' -d Specify\ a\ section
374
- complete -c doing -l times -s t -f -n '__fish_doing_using_command yesterday' -d Show\ time\ intervals\ on\ @done\ tasks
375
- complete -c doing -l tag_order -f -r -n '__fish_doing_using_command yesterday' -d Tag\ sort\ direction
376
- complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command yesterday' -d Sort\ tags\ by
377
- complete -c doing -l totals -f -n '__fish_doing_using_command yesterday' -d Show\ time\ totals\ at\ the\ end\ of\ output
378
- 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)'
data/lib/doing/array.rb CHANGED
@@ -5,17 +5,53 @@ module Doing
5
5
  ## Array helpers
6
6
  ##
7
7
  class ::Array
8
+ # Convert strings to @tags
9
+ #
10
+ # @example `['one', '@two', 'three'].to_tags`
11
+ # @example `=> ['@one', '@two', '@three']`
12
+ # @return [Array] Array of @tags
13
+ #
8
14
  def to_tags
9
15
  map { |t| t.sub(/^@?/, '@') }
10
16
  end
11
17
 
18
+ def to_tags!
19
+ replace to_tags
20
+ end
21
+
22
+ ##
23
+ ## Hightlight @tags in string for console output
24
+ ##
25
+ ## @param color [String] the color to highlight
26
+ ## with
27
+ ##
28
+ ## @return [String] string with @tags highlighted
29
+ ##
12
30
  def highlight_tags(color = 'cyan')
13
31
  tag_color = Doing::Color.send(color)
14
32
  to_tags.map { |t| "#{tag_color}#{t}" }
15
33
  end
16
34
 
35
+ ##
36
+ ## Tag array for logging
37
+ ##
38
+ ## @return [String] Highlighted tag array joined with comma
39
+ ##
17
40
  def log_tags
18
41
  highlight_tags.join(', ')
19
42
  end
43
+
44
+ ##
45
+ ## Convert array to nested hash, setting last key to value
46
+ ##
47
+ ## @param value The value to set
48
+ ##
49
+ def nested_hash(value)
50
+ raise StandardError, 'Value can not be nil' if value.nil?
51
+
52
+ hsh = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
53
+ hsh.dig(*self[0..-2])[self.fetch(-1)] = value
54
+ hsh
55
+ end
20
56
  end
21
57
  end
data/lib/doing/colors.rb CHANGED
@@ -1,64 +1,65 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Cribbed from <https://github.com/flori/term-ansicolor>
2
4
  module Doing
5
+ # Terminal color functions
3
6
  module Color
4
-
5
7
  # :stopdoc:
6
8
  ATTRIBUTES = [
7
- [ :clear , 0 ], # String#clear is already used to empty string in Ruby 1.9
8
- [ :reset , 0 ], # synonym for :clear
9
- [ :bold , 1 ],
10
- [ :dark , 2 ],
11
- [ :italic , 3 ], # not widely implemented
12
- [ :underline , 4 ],
13
- [ :underscore , 4 ], # synonym for :underline
14
- [ :blink , 5 ],
15
- [ :rapid_blink , 6 ], # not widely implemented
16
- [ :negative , 7 ], # no reverse because of String#reverse
17
- [ :concealed , 8 ],
18
- [ :strikethrough , 9 ], # not widely implemented
19
- [ :black , 30 ],
20
- [ :red , 31 ],
21
- [ :green , 32 ],
22
- [ :yellow , 33 ],
23
- [ :blue , 34 ],
24
- [ :magenta , 35 ],
25
- [ :cyan , 36 ],
26
- [ :white , 37 ],
27
- [ :bgblack , 40 ],
28
- [ :bgred , 41 ],
29
- [ :bggreen , 42 ],
30
- [ :bgyellow , 43 ],
31
- [ :bgblue , 44 ],
32
- [ :bgmagenta , 45 ],
33
- [ :bgcyan , 46 ],
34
- [ :bgwhite , 47 ],
35
- [ :boldblack , 90 ], # High intensity, aixterm (works in OS X)
36
- [ :boldred , 91 ],
37
- [ :boldgreen , 92 ],
38
- [ :boldyellow , 93 ],
39
- [ :boldblue , 94 ],
40
- [ :boldmagenta , 95 ],
41
- [ :boldcyan , 96 ],
42
- [ :boldwhite , 97 ],
43
- [ :boldbgblack , 100 ], # High intensity background, aixterm (works in OS X)
44
- [ :boldbgred , 101 ],
45
- [ :boldbggreen , 102 ],
46
- [ :boldbgyellow , 103 ],
47
- [ :boldbgblue , 104 ],
48
- [ :boldbgmagenta , 105 ],
49
- [ :boldbgcyan , 106 ],
50
- [ :boldbgwhite , 107 ],
51
- [ :softpurple , '0;35;40'],
52
- [ :hotpants , '7;34;40'],
53
- [ :knightrider , '7;30;40'],
54
- [ :flamingo , '7;31;47'],
55
- [ :yeller , '1;37;43'],
56
- [ :whiteboard , '1;30;47'],
57
- [ :default , '0;39' ]
58
- ]
9
+ [:clear, 0], # String#clear is already used to empty string in Ruby 1.9
10
+ [:reset, 0], # synonym for :clear
11
+ [:bold, 1],
12
+ [:dark, 2],
13
+ [:italic, 3], # not widely implemented
14
+ [:underline, 4],
15
+ [:underscore, 4], # synonym for :underline
16
+ [:blink, 5],
17
+ [:rapid_blink, 6], # not widely implemented
18
+ [:negative, 7], # no reverse because of String#reverse
19
+ [:concealed, 8],
20
+ [:strikethrough, 9], # not widely implemented
21
+ [:black, 30],
22
+ [:red, 31],
23
+ [:green, 32],
24
+ [:yellow, 33],
25
+ [:blue, 34],
26
+ [:magenta, 35],
27
+ [:cyan, 36],
28
+ [:white, 37],
29
+ [:bgblack, 40],
30
+ [:bgred, 41],
31
+ [:bggreen, 42],
32
+ [:bgyellow, 43],
33
+ [:bgblue, 44],
34
+ [:bgmagenta, 45],
35
+ [:bgcyan, 46],
36
+ [:bgwhite, 47],
37
+ [:boldblack, 90], # High intensity, aixterm (works in OS X)
38
+ [:boldred, 91],
39
+ [:boldgreen, 92],
40
+ [:boldyellow, 93],
41
+ [:boldblue, 94],
42
+ [:boldmagenta, 95],
43
+ [:boldcyan, 96],
44
+ [:boldwhite, 97],
45
+ [:boldbgblack, 100], # High intensity background, aixterm (works in OS X)
46
+ [:boldbgred, 101],
47
+ [:boldbggreen, 102],
48
+ [:boldbgyellow, 103],
49
+ [:boldbgblue, 104],
50
+ [:boldbgmagenta, 105],
51
+ [:boldbgcyan, 106],
52
+ [:boldbgwhite, 107],
53
+ [:softpurple, '0;35;40'],
54
+ [:hotpants, '7;34;40'],
55
+ [:knightrider, '7;30;40'],
56
+ [:flamingo, '7;31;47'],
57
+ [:yeller, '1;37;43'],
58
+ [:whiteboard, '1;30;47'],
59
+ [:default, '0;39']
60
+ ].map(&:freeze).freeze
59
61
 
60
62
  ATTRIBUTE_NAMES = ATTRIBUTES.transpose.first
61
- # :startdoc:
62
63
 
63
64
  # Returns true if Doing::Color supports the +feature+.
64
65
  #
@@ -72,19 +73,23 @@ module Doing
72
73
  !String.instance_methods(false).map(&:to_sym).include?(:clear)
73
74
  end
74
75
  end
75
- # Returns true, if the coloring function of this module
76
- # is switched on, false otherwise.
77
- def self.coloring?
78
- @coloring
79
- end
80
76
 
81
- # Turns the coloring on or off globally, so you can easily do
82
- # this for example:
83
- # Doing::Color::coloring = STDOUT.isatty
84
- def self.coloring=(val)
85
- @coloring = val
77
+ class << self
78
+ # Returns true, if the coloring function of this module
79
+ # is switched on, false otherwise.
80
+ def coloring?
81
+ @coloring
82
+ end
83
+
84
+ # Turns the coloring on or off globally, so you can easily do
85
+ # this for example:
86
+ # Doing::Color::coloring = STDOUT.isatty
87
+ attr_writer :coloring
88
+
89
+ def coloring
90
+ @coloring ||= true
91
+ end
86
92
  end
87
- self.coloring = true
88
93
 
89
94
  ATTRIBUTES.each do |c, v|
90
95
  eval <<-EOT
@@ -133,4 +138,3 @@ module Doing
133
138
  extend self
134
139
  end
135
140
  end
136
-
@@ -7,7 +7,6 @@ module Doing
7
7
  first = true
8
8
  out = []
9
9
  logic = []
10
- need_export = []
11
10
 
12
11
  @commands.each_with_index do |cmd, i|
13
12
  @bar.advance
@@ -135,7 +134,7 @@ module Doing
135
134
  end
136
135
 
137
136
  def parse_option(option)
138
- res = option.match(/(?:-(?<short>\w), )?(?:--(?:\[no-\])?(?<long>[\w_]+)(?:=(?<arg>\w+))?)\s+- (?<desc>.*?)$/)
137
+ res = option.match(/(?:-(?<short>\w), )?(?:--(?:\[no-\])?(?<long>\w+)(?:=(?<arg>\w+))?)\s+- (?<desc>.*?)$/)
139
138
  return nil unless res
140
139
  {
141
140
  short: res['short'],
@@ -80,7 +80,7 @@ module Doing
80
80
  end
81
81
 
82
82
  def parse_option(option)
83
- res = option.match(/(?:-(?<short>\w), )?(?:--(?:\[no-\])?(?<long>[\w_]+)(?:=(?<arg>\w+))?)\s+- (?<desc>.*?)$/)
83
+ res = option.match(/(?:-(?<short>\w), )?(?:--(?:\[no-\])?(?<long>w+)(?:=(?<arg>\w+))?)\s+- (?<desc>.*?)$/)
84
84
  return nil unless res
85
85
  {
86
86
  short: res['short'],
@@ -51,7 +51,7 @@ module Doing
51
51
  end
52
52
 
53
53
  def parse_option(option)
54
- res = option.match(/(?:-(?<short>\w), )?(?:--(?:\[no-\])?(?<long>[\w_]+)(?:=(?<arg>\w+))?)\s+- (?<desc>.*?)$/)
54
+ res = option.match(/(?:-(?<short>\w), )?(?:--(?:\[no-\])?(?<long>w+)(?:=(?<arg>\w+))?)\s+- (?<desc>.*?)$/)
55
55
  return nil unless res
56
56
 
57
57
  {
@@ -12,6 +12,12 @@ module Doing
12
12
  # Completion script generator
13
13
  module Completion
14
14
  class << self
15
+ # Generate a completion script and output to file or
16
+ # stdout
17
+ #
18
+ # @param type [String] shell to generate for (zsh|bash|fish)
19
+ # @param file [String] Path to save to, or 'stdout'
20
+ #
15
21
  def generate_completion(type: 'zsh', file: 'stdout')
16
22
 
17
23
  generator = case type.to_s