doing 2.1.57 → 2.1.61

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +46 -0
  3. data/Gemfile.lock +2 -2
  4. data/README.md +1 -1
  5. data/bin/commands/done.rb +13 -4
  6. data/bin/commands/show.rb +13 -4
  7. data/bin/commands/update.rb +37 -0
  8. data/bin/doing +1 -1
  9. data/docs/doc/Array.html +1 -1
  10. data/docs/doc/BooleanTermParser/Clause.html +1 -1
  11. data/docs/doc/BooleanTermParser/Operator.html +1 -1
  12. data/docs/doc/BooleanTermParser/Query.html +1 -1
  13. data/docs/doc/BooleanTermParser/QueryParser.html +1 -1
  14. data/docs/doc/BooleanTermParser/QueryTransformer.html +1 -1
  15. data/docs/doc/BooleanTermParser.html +1 -1
  16. data/docs/doc/Doing/ArrayCleanup.html +1 -1
  17. data/docs/doc/Doing/ArrayNestedHash.html +1 -1
  18. data/docs/doc/Doing/ArrayTags.html +1 -1
  19. data/docs/doc/Doing/CSVExport.html +1 -1
  20. data/docs/doc/Doing/CalendarImport.html +1 -1
  21. data/docs/doc/Doing/Change.html +1 -1
  22. data/docs/doc/Doing/Changes.html +1 -1
  23. data/docs/doc/Doing/ChronifyArray.html +1 -1
  24. data/docs/doc/Doing/ChronifyNumeric.html +1 -1
  25. data/docs/doc/Doing/ChronifyString.html +1 -1
  26. data/docs/doc/Doing/Color.html +35 -1
  27. data/docs/doc/Doing/Completion/BashCompletions.html +1 -1
  28. data/docs/doc/Doing/Completion/FigCompletions.html +1 -1
  29. data/docs/doc/Doing/Completion/FishCompletions.html +1 -1
  30. data/docs/doc/Doing/Completion/StringUtils.html +65 -7
  31. data/docs/doc/Doing/Completion/ZshCompletions.html +1 -1
  32. data/docs/doc/Doing/Completion.html +1 -1
  33. data/docs/doc/Doing/Configuration.html +1 -1
  34. data/docs/doc/Doing/DayOneRenderer.html +1 -1
  35. data/docs/doc/Doing/DayoneExport.html +1 -1
  36. data/docs/doc/Doing/DoingExport.html +1 -1
  37. data/docs/doc/Doing/DoingImport.html +1 -1
  38. data/docs/doc/Doing/Entry.html +1 -1
  39. data/docs/doc/Doing/Errors/DoingNoTraceError.html +1 -1
  40. data/docs/doc/Doing/Errors/DoingRuntimeError.html +1 -1
  41. data/docs/doc/Doing/Errors/DoingStandardError.html +1 -1
  42. data/docs/doc/Doing/Errors/EmptyInput.html +1 -1
  43. data/docs/doc/Doing/Errors/HistoryLimitError.html +1 -1
  44. data/docs/doc/Doing/Errors/InvalidPlugin.html +1 -1
  45. data/docs/doc/Doing/Errors/MissingBackupFile.html +1 -1
  46. data/docs/doc/Doing/Errors/NoResults.html +1 -1
  47. data/docs/doc/Doing/Errors/PluginException.html +1 -1
  48. data/docs/doc/Doing/Errors/UserCancelled.html +1 -1
  49. data/docs/doc/Doing/Errors/WrongCommand.html +1 -1
  50. data/docs/doc/Doing/Errors.html +1 -1
  51. data/docs/doc/Doing/HTMLExport.html +1 -1
  52. data/docs/doc/Doing/Hooks.html +1 -1
  53. data/docs/doc/Doing/Item.html +2 -2
  54. data/docs/doc/Doing/ItemDates.html +1 -1
  55. data/docs/doc/Doing/ItemQuery.html +1 -1
  56. data/docs/doc/Doing/ItemState.html +1 -1
  57. data/docs/doc/Doing/ItemTags.html +1 -1
  58. data/docs/doc/Doing/Items.html +1 -1
  59. data/docs/doc/Doing/JSONExport.html +1 -1
  60. data/docs/doc/Doing/JSONImport.html +1 -1
  61. data/docs/doc/Doing/Logger.html +1 -1
  62. data/docs/doc/Doing/MarkdownExport.html +1 -1
  63. data/docs/doc/Doing/Note.html +1 -1
  64. data/docs/doc/Doing/Pager.html +1 -1
  65. data/docs/doc/Doing/Plugins.html +1 -1
  66. data/docs/doc/Doing/Prompt.html +2 -2
  67. data/docs/doc/Doing/PromptChoose.html +1 -1
  68. data/docs/doc/Doing/PromptFZF.html +1 -1
  69. data/docs/doc/Doing/PromptInput.html +1 -1
  70. data/docs/doc/Doing/PromptSTD.html +1 -1
  71. data/docs/doc/Doing/PromptYN.html +1 -1
  72. data/docs/doc/Doing/Section.html +1 -1
  73. data/docs/doc/Doing/StringHighlight.html +1 -1
  74. data/docs/doc/Doing/StringNormalize.html +1 -1
  75. data/docs/doc/Doing/StringQuery.html +61 -5
  76. data/docs/doc/Doing/StringTags.html +1 -1
  77. data/docs/doc/Doing/StringTransform.html +1 -1
  78. data/docs/doc/Doing/StringTruncate.html +1 -1
  79. data/docs/doc/Doing/StringURL.html +1 -1
  80. data/docs/doc/Doing/SymbolNormalize.html +1 -1
  81. data/docs/doc/Doing/TaskPaperExport.html +1 -1
  82. data/docs/doc/Doing/TemplateExport.html +2 -2
  83. data/docs/doc/Doing/TemplateString.html +2 -2
  84. data/docs/doc/Doing/TimingImport.html +1 -1
  85. data/docs/doc/Doing/Types.html +1 -1
  86. data/docs/doc/Doing/Util/Backup.html +1 -1
  87. data/docs/doc/Doing/Util.html +1 -1
  88. data/docs/doc/Doing/Version.html +1 -1
  89. data/docs/doc/Doing/WWID.html +2 -2
  90. data/docs/doc/Doing.html +2 -2
  91. data/docs/doc/FalseClass.html +1 -1
  92. data/docs/doc/GLI/Commands/Help.html +1 -1
  93. data/docs/doc/GLI/Commands/MarkdownDocumentListener.html +1 -1
  94. data/docs/doc/GLI/Commands.html +1 -1
  95. data/docs/doc/GLI.html +1 -1
  96. data/docs/doc/Hash.html +34 -5
  97. data/docs/doc/Numeric.html +1 -1
  98. data/docs/doc/Object.html +1 -1
  99. data/docs/doc/PhraseParser/Operator.html +1 -1
  100. data/docs/doc/PhraseParser/PhraseClause.html +1 -1
  101. data/docs/doc/PhraseParser/Query.html +1 -1
  102. data/docs/doc/PhraseParser/QueryParser.html +1 -1
  103. data/docs/doc/PhraseParser/QueryTransformer.html +1 -1
  104. data/docs/doc/PhraseParser/TermClause.html +1 -1
  105. data/docs/doc/PhraseParser.html +1 -1
  106. data/docs/doc/Status.html +1 -1
  107. data/docs/doc/String.html +2 -2
  108. data/docs/doc/Symbol.html +1 -1
  109. data/docs/doc/Time.html +1 -1
  110. data/docs/doc/TrueClass.html +1 -1
  111. data/docs/doc/_index.html +1 -1
  112. data/docs/doc/file.README.html +2 -2
  113. data/docs/doc/index.html +2 -2
  114. data/docs/doc/method_list.html +364 -356
  115. data/docs/doc/top-level-namespace.html +1 -1
  116. data/doing.rdoc +22 -5
  117. data/lib/completion/_doing.zsh +5 -1
  118. data/lib/completion/doing.bash +13 -2
  119. data/lib/completion/doing.fish +5 -2
  120. data/lib/completion/doing.ts +28 -4
  121. data/lib/doing/colors.rb +14 -1
  122. data/lib/doing/completion/completion_string.rb +11 -0
  123. data/lib/doing/hash.rb +6 -0
  124. data/lib/doing/logger.rb +3 -4
  125. data/lib/doing/string/query.rb +10 -0
  126. data/lib/doing/template_string.rb +3 -2
  127. data/lib/doing/version.rb +1 -1
  128. data/lib/doing/wwid/modify.rb +1 -1
  129. data/lib/doing/wwid/timers.rb +1 -156
  130. data/lib/templates/doing.css +2 -2
  131. metadata +3 -2
@@ -216,7 +216,7 @@
216
216
  </div>
217
217
 
218
218
  <div id="footer">
219
- Generated on Thu May 26 11:23:25 2022 by
219
+ Generated on Wed Jun 29 05:57:08 2022 by
220
220
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
221
221
  0.9.27 (ruby-3.0.1).
222
222
  </div>
data/doing.rdoc CHANGED
@@ -5,7 +5,7 @@ record of what you've been doing, complete with tag-based time tracking. The
5
5
  command line tool allows you to add entries, annotate with tags and notes, and
6
6
  view your entries with myriad options, with a focus on a "natural" language syntax.
7
7
 
8
- v2.1.57
8
+ v2.1.61
9
9
 
10
10
  === Global Options
11
11
  === --config_file arg
@@ -2333,12 +2333,11 @@ Output to export format (csv|dayone|dayone-days|dayone-entries|doing|html|json|m
2333
2333
  [Default Value] None
2334
2334
 
2335
2335
 
2336
- ===== -s|--sort ORDER
2336
+ ===== -s|--section NAME
2337
2337
 
2338
- Sort order (asc/desc)
2338
+ Only show entries within section
2339
2339
 
2340
- [Default Value] asc
2341
- [Must Match] (?i-mx:^(?:a(?:sc)?|d(?:esc)?)$)
2340
+ [Default Value] None
2342
2341
 
2343
2342
 
2344
2343
  ===== --save VIEW_NAME
@@ -2356,6 +2355,14 @@ Filter entries using a search query, surround with slashes for regex (e.g. "/que
2356
2355
  [Default Value] None
2357
2356
 
2358
2357
 
2358
+ ===== --sort ORDER
2359
+
2360
+ Sort order (asc/desc)
2361
+
2362
+ [Default Value] asc
2363
+ [Must Match] (?i-mx:^(?:a(?:sc)?|d(?:esc)?)$)
2364
+
2365
+
2359
2366
  ===== --tag TAG
2360
2367
 
2361
2368
  Filter entries by tag. Combine multiple tags with a comma. Wildcards allowed (*, ?)
@@ -3002,6 +3009,16 @@ Redo last undo. Note: you cannot undo a redo
3002
3009
 
3003
3010
 
3004
3011
 
3012
+ ==== Command: <tt>update </tt>
3013
+ Update doing to the latest version
3014
+
3015
+ Checks for the latest available version of doing and updates your local install if needed.
3016
+ ===== Options
3017
+ ===== -p|--pre|--beta
3018
+ Check for pre-release version
3019
+
3020
+
3021
+
3005
3022
  ==== Command: <tt>view VIEW_NAME</tt>
3006
3023
  Display a user-created view
3007
3024
 
@@ -52,6 +52,7 @@ function _doing() {
52
52
  'test:Test Stuff'
53
53
  'today:List entries from today'
54
54
  'undo:Undo the last X changes to the Doing file'
55
+ 'update:Update doing to the latest version'
55
56
  'view:Display a user-created view'
56
57
  'views:List available custom views'
57
58
  'wiki:Output a tag wiki'
@@ -174,7 +175,7 @@ function _doing() {
174
175
  args=( {'(--archive)-a','(-a)--archive'}"[Archive selected items]" "--after[Select entries newer than date]:DATE_STRING:" "--resume[Copy selection as a new entry with current time and no @done tag]" "--before[Select entries older than date]:DATE_STRING:" {'(--cancel)-c','(-c)--cancel'}"[Cancel selected items]" "--case[Case sensitivity for search string matching [(c)ase-sensitive]:TYPE:" {'(--delete)-d','(-d)--delete'}"[Delete selected items]" {'(--editor)-e','(-e)--editor'}"[Edit selected item(s)]" {'(--finish)-f','(-f)--finish'}"[Add @done with current time to selected item(s)]" "--flag[Add flag to selected item(s)]" "--force[Perform action without confirmation]" "--from[Date range]:DATE_OR_RANGE:" {'(--move)-m','(-m)--move'}"[Move selected items to section]:SECTION:" "--menu[Use --no-menu to skip the interactive menu]" "--not[Select items that *don't* match search/tag filters]" {'(--output)-o','(-o)--output'}"[Output entries to format]:FORMAT:" {'(--query)-q','(-q)--query'}"[Initial search query for filtering]:QUERY:" {'(--remove)-r','(-r)--remove'}"[Reverse -c]" {'(--section)-s','(-s)--section'}"[Select from a specific section]:SECTION:" "--save_to[Save selected entries to file using --output format]:FILE:" "--search[Filter entries using a search query]:QUERY:" {'(--tag)-t','(-t)--tag'}"[Tag selected entries]:TAG:" "--val[Perform a tag value query]:QUERY:" {'(--exact)-x','(-x)--exact'}"[Force exact search string matching]" )
175
176
  ;;
176
177
  show)
177
- args=( {'(--age)-a','(-a)--age'}"[Age]:AGE:" "--after[Show entries newer than date]:DATE_STRING:" "--before[Show entries older than date]:DATE_STRING:" "--bool[Boolean used to combine multiple tags]:BOOLEAN:" {'(--count)-c','(-c)--count'}"[Max count to show]:MAX:" "--case[Case sensitivity for search string matching [(c)ase-sensitive]:TYPE:" "--config_template[Output using a template from configuration]:TEMPLATE_KEY:" "--duration[Show elapsed time on entries without @done tag]" {'(--editor)-e','(-e)--editor'}"[Edit matching entries with vim]" "--from[Date range]:DATE_OR_RANGE:" {'(--hilite)-h','(-h)--hilite'}"[Highlight search matches in output]" {'(--interactive)-i','(-i)--interactive'}"[Select from a menu of matching entries to perform additional operations]" {'(--menu)-m','(-m)--menu'}"[Select section or tag to display from a menu]" "--not[Show items that *don't* match search/tag filters]" {'(--output)-o','(-o)--output'}"[Output to export format]:FORMAT:" "--only_timed[Only show items with recorded time intervals]" {'(--sort)-s','(-s)--sort'}"[Sort order]:ORDER:" "--save[Save all current command line options as a new view]:VIEW_NAME:" "--search[Filter entries using a search query]:QUERY:" {'(--times)-t','(-t)--times'}"[Show time intervals on @done tasks]" "--tag[Filter entries by tag]:TAG:" "--tag_order[Tag sort direction]:DIRECTION:" "--tag_sort[Sort tags by]:KEY:" "--template[Override output format with a template string containing %placeholders]:TEMPLATE_STRING:" "--title[Title string to be used for output formats that require it]:TITLE:" "--totals[Show time totals at the end of output]" "--val[Perform a tag value query]:QUERY:" {'(--exact)-x','(-x)--exact'}"[Force exact search string matching]" )
178
+ args=( {'(--age)-a','(-a)--age'}"[Age]:AGE:" "--after[Show entries newer than date]:DATE_STRING:" "--before[Show entries older than date]:DATE_STRING:" "--bool[Boolean used to combine multiple tags]:BOOLEAN:" {'(--count)-c','(-c)--count'}"[Max count to show]:MAX:" "--case[Case sensitivity for search string matching [(c)ase-sensitive]:TYPE:" "--config_template[Output using a template from configuration]:TEMPLATE_KEY:" "--duration[Show elapsed time on entries without @done tag]" {'(--editor)-e','(-e)--editor'}"[Edit matching entries with vim]" "--from[Date range]:DATE_OR_RANGE:" {'(--hilite)-h','(-h)--hilite'}"[Highlight search matches in output]" {'(--interactive)-i','(-i)--interactive'}"[Select from a menu of matching entries to perform additional operations]" {'(--menu)-m','(-m)--menu'}"[Select section or tag to display from a menu]" "--not[Show items that *don't* match search/tag filters]" {'(--output)-o','(-o)--output'}"[Output to export format]:FORMAT:" "--only_timed[Only show items with recorded time intervals]" {'(--section)-s','(-s)--section'}"[Only show entries within section]:NAME:" "--save[Save all current command line options as a new view]:VIEW_NAME:" "--search[Filter entries using a search query]:QUERY:" "--sort[Sort order]:ORDER:" {'(--times)-t','(-t)--times'}"[Show time intervals on @done tasks]" "--tag[Filter entries by tag]:TAG:" "--tag_order[Tag sort direction]:DIRECTION:" "--tag_sort[Sort tags by]:KEY:" "--template[Override output format with a template string containing %placeholders]:TEMPLATE_STRING:" "--title[Title string to be used for output formats that require it]:TITLE:" "--totals[Show time totals at the end of output]" "--val[Perform a tag value query]:QUERY:" {'(--exact)-x','(-x)--exact'}"[Force exact search string matching]" )
178
179
  ;;
179
180
  since)
180
181
  args=( "--bool[Boolean used to combine multiple tags]:BOOLEAN:" "--case[Case sensitivity for search string matching [(c)ase-sensitive]:TYPE:" "--config_template[Output using a template from configuration]:TEMPLATE_KEY:" "--duration[Show elapsed time on entries without @done tag]" "--not[Since items that *don't* match search/tag filters]" {'(--output)-o','(-o)--output'}"[Output to export format]:FORMAT:" "--only_timed[Only show items with recorded time intervals]" {'(--section)-s','(-s)--section'}"[Section]:NAME:" "--save[Save all current command line options as a new view]:VIEW_NAME:" "--search[Filter entries using a search query]:QUERY:" {'(--times)-t','(-t)--times'}"[Show time intervals on @done tasks]" "--tag[Filter entries by tag]:TAG:" "--tag_order[Tag sort direction]:DIRECTION:" "--tag_sort[Sort tags by]:KEY:" "--template[Override output format with a template string containing %placeholders]:TEMPLATE_STRING:" "--title[Title string to be used for output formats that require it]:TITLE:" "--totals[Show time totals at the end of output]" "--val[Perform a tag value query]:QUERY:" {'(--exact)-x','(-x)--exact'}"[Force exact search string matching]" )
@@ -200,6 +201,9 @@ function _doing() {
200
201
  undo)
201
202
  args=( {'(--file)-f','(-f)--file'}"[Specify alternate doing file]:PATH:" {'(--interactive)-i','(-i)--interactive'}"[Select from recent backups]" {'(--prune)-p','(-p)--prune'}"[Remove old backups]:COUNT:" {'(--redo)-r','(-r)--redo'}"[Redo last undo]" )
202
203
  ;;
204
+ update)
205
+ args=( "--beta[Check for pre-release version]" )
206
+ ;;
203
207
  view)
204
208
  args=( "--after[Show entries newer than date]:DATE_STRING:" "--age[Age]:AGE:" "--before[Show entries older than date]:DATE_STRING:" "--bool[Boolean used to combine multiple tags]:BOOLEAN:" {'(--count)-c','(-c)--count'}"[Count to display]:COUNT:" "--case[Case sensitivity for search string matching [(c)ase-sensitive]:TYPE:" "--color[Include colors in output]" "--config_template[Output using a template from configuration]:TEMPLATE_KEY:" "--duration[Show elapsed time on entries without @done tag]" "--from[Date range]:DATE_OR_RANGE:" {'(--hilite)-h','(-h)--hilite'}"[Highlight search matches in output]" {'(--interactive)-i','(-i)--interactive'}"[Select from a menu of matching entries to perform additional operations]" "--not[Show items that *don't* match search/tag filters]" {'(--output)-o','(-o)--output'}"[Output to export format]:FORMAT:" "--only_timed[Only show items with recorded time intervals]" {'(--section)-s','(-s)--section'}"[Section]:NAME:" "--search[Filter entries using a search query]:QUERY:" {'(--times)-t','(-t)--times'}"[Show time intervals on @done tasks]" "--tag[Filter entries by tag]:TAG:" "--tag_order[Tag sort direction]:DIRECTION:" "--tag_sort[Sort tags by]:KEY:" "--template[Override output format with a template string containing %placeholders]:TEMPLATE_STRING:" "--totals[Show intervals with totals at the end of output]" "--val[Perform a tag value query]:QUERY:" {'(--exact)-x','(-x)--exact'}"[Force exact search string matching]" )
205
209
  ;;
@@ -276,9 +276,9 @@ local words=$(doing sections)
276
276
  IFS="$OLD_IFS"
277
277
 
278
278
  if [[ "$token" == --* ]]; then
279
- COMPREPLY=( $( compgen -W '--age --after --before --bool --count --case --config_template --duration --editor --from --hilite --interactive --menu --not --output --only_timed --sort --save --search --times --tag --tag_order --tag_sort --template --title --totals --val --exact' -- $token ) )
279
+ COMPREPLY=( $( compgen -W '--age --after --before --bool --count --case --config_template --duration --editor --from --hilite --interactive --menu --not --output --only_timed --section --save --search --sort --times --tag --tag_order --tag_sort --template --title --totals --val --exact' -- $token ) )
280
280
  elif [[ "$token" == -* ]]; then
281
- COMPREPLY=( $( compgen -W '-a -c -e -h -i -m -o -s -t -x --age --after --before --bool --count --case --config_template --duration --editor --from --hilite --interactive --menu --not --output --only_timed --sort --save --search --times --tag --tag_order --tag_sort --template --title --totals --val --exact' -- $token ) )
281
+ COMPREPLY=( $( compgen -W '-a -c -e -h -i -m -o -s -t -x --age --after --before --bool --count --case --config_template --duration --editor --from --hilite --interactive --menu --not --output --only_timed --section --save --search --sort --times --tag --tag_order --tag_sort --template --title --totals --val --exact' -- $token ) )
282
282
  else
283
283
  local nocasematchWasOff=0
284
284
  shopt nocasematch >/dev/null || nocasematchWasOff=1
@@ -368,6 +368,16 @@ _doing_undo() {
368
368
  fi
369
369
  }
370
370
 
371
+ _doing_update() {
372
+
373
+ if [[ "$token" == --* ]]; then
374
+ COMPREPLY=( $( compgen -W '--beta' -- $token ) )
375
+ elif [[ "$token" == -* ]]; then
376
+ COMPREPLY=( $( compgen -W ' --beta' -- $token ) )
377
+
378
+ fi
379
+ }
380
+
371
381
  _doing_view() {
372
382
  OLD_IFS="$IFS"
373
383
  local token=${COMP_WORDS[$COMP_CWORD]}
@@ -466,6 +476,7 @@ _doing()
466
476
  elif [[ $last =~ (template) ]]; then _doing_template
467
477
  elif [[ $last =~ (today) ]]; then _doing_today
468
478
  elif [[ $last =~ (undo) ]]; then _doing_undo
479
+ elif [[ $last =~ (update) ]]; then _doing_update
469
480
  elif [[ $last =~ (view) ]]; then _doing_view
470
481
  elif [[ $last =~ (views) ]]; then _doing_views
471
482
  elif [[ $last =~ (wiki) ]]; then _doing_wiki
@@ -172,6 +172,7 @@ complete -xc doing -n '__fish_doing_needs_command' -a 'template' -d Output\ HTML
172
172
  complete -xc doing -n '__fish_doing_needs_command' -a 'test' -d Test\ Stuff
173
173
  complete -xc doing -n '__fish_doing_needs_command' -a 'today' -d List\ entries\ from\ today
174
174
  complete -xc doing -n '__fish_doing_needs_command' -a 'undo' -d Undo\ the\ last\ X\ changes\ to\ the\ Doing\ file
175
+ complete -xc doing -n '__fish_doing_needs_command' -a 'update' -d Update\ doing\ to\ the\ latest\ version
175
176
  complete -xc doing -n '__fish_doing_needs_command' -a 'view' -d Display\ a\ user-created\ view
176
177
  complete -xc doing -n '__fish_doing_needs_command' -a 'views' -d List\ available\ custom\ views
177
178
  complete -xc doing -n '__fish_doing_needs_command' -a 'wiki' -d Output\ a\ tag\ wiki
@@ -470,9 +471,10 @@ complete -c doing -l menu -s m -f -n '__fish_doing_using_command show' -d Selec
470
471
  complete -c doing -l not -f -n '__fish_doing_using_command show' -d Show\ items\ that\ \*don\'t\*\ match\ search/tag\ filters
471
472
  complete -c doing -l output -s o -f -r -n '__fish_doing_using_command show' -d Output\ to\ export\ format
472
473
  complete -c doing -l only_timed -f -n '__fish_doing_using_command show' -d Only\ show\ items\ with\ recorded\ time\ intervals
473
- complete -c doing -l sort -s s -f -r -n '__fish_doing_using_command show' -d Sort\ order
474
+ complete -c doing -l section -s s -f -r -n '__fish_doing_using_command show' -d Only\ show\ entries\ within\ section
474
475
  complete -c doing -l save -f -r -n '__fish_doing_using_command show' -d Save\ all\ current\ command\ line\ options\ as\ a\ new\ view
475
476
  complete -c doing -l search -f -r -n '__fish_doing_using_command show' -d Filter\ entries\ using\ a\ search\ query
477
+ complete -c doing -l sort -f -r -n '__fish_doing_using_command show' -d Sort\ order
476
478
  complete -c doing -l times -s t -f -n '__fish_doing_using_command show' -d Show\ time\ intervals\ on\ @done\ tasks
477
479
  complete -c doing -l tag -f -r -n '__fish_doing_using_command show' -d Filter\ entries\ by\ tag
478
480
  complete -c doing -l tag_order -f -r -n '__fish_doing_using_command show' -d Tag\ sort\ direction
@@ -558,6 +560,7 @@ complete -c doing -l file -s f -f -r -n '__fish_doing_using_command undo' -d Spe
558
560
  complete -c doing -l interactive -s i -f -n '__fish_doing_using_command undo' -d Select\ from\ recent\ backups
559
561
  complete -c doing -l prune -s p -f -r -n '__fish_doing_using_command undo' -d Remove\ old\ backups
560
562
  complete -c doing -l redo -s r -f -n '__fish_doing_using_command undo' -d Redo\ last\ undo
563
+ complete -c doing -l beta -f -n '__fish_doing_using_command update' -d Check\ for\ pre-release\ version
561
564
  complete -c doing -l after -f -r -n '__fish_doing_using_command view' -d Show\ entries\ newer\ than\ date
562
565
  complete -c doing -l age -f -r -n '__fish_doing_using_command view' -d Age
563
566
  complete -c doing -l before -f -r -n '__fish_doing_using_command view' -d Show\ entries\ older\ than\ date
@@ -617,4 +620,4 @@ complete -f -c doing -l sort -x -n '__fish_doing_using_command changes changelog
617
620
  complete -f -c doing -l tag_sort -x -n '__fish_doing_using_command grep search on recent show since today view yesterday' -a 'name time'
618
621
  complete -f -c doing -l tag_order -x -n '__fish_doing_using_command grep search on recent show since today view yesterday' -a 'asc desc'
619
622
  complete -f -c doing -s a -l age -x -n '__fish_doing_using_command show view' -a 'oldest newest'
620
- complete -f -c doing -s s -l section -x -n '__fish_doing_using_command again resume autotag cancel done did finish grep search import last mark flag meanwhile note now next on recent reset begin rotate select since tag tags today view wiki yesterday' -a '(__fish_doing_complete_sections)'
623
+ complete -f -c doing -s s -l section -x -n '__fish_doing_using_command again resume autotag cancel done did finish grep search import last mark flag meanwhile note now next on recent reset begin rotate select show since tag tags today view wiki yesterday' -a '(__fish_doing_complete_sections)'
@@ -3648,11 +3648,11 @@ const completionSpec: Fig.Spec = {
3648
3648
  },
3649
3649
 
3650
3650
  {
3651
- name: ["-s", "--sort"],
3652
- description: "Sort order",
3651
+ name: ["-s", "--section"],
3652
+ description: "Only show entries within section",
3653
3653
  args: {
3654
- name: "ORDER",
3655
- description: "ORDER",
3654
+ name: "NAME",
3655
+ description: "NAME",
3656
3656
  },
3657
3657
 
3658
3658
  },
@@ -3677,6 +3677,16 @@ const completionSpec: Fig.Spec = {
3677
3677
 
3678
3678
  },
3679
3679
 
3680
+ {
3681
+ name: ["--sort"],
3682
+ description: "Sort order",
3683
+ args: {
3684
+ name: "ORDER",
3685
+ description: "ORDER",
3686
+ },
3687
+
3688
+ },
3689
+
3680
3690
  {
3681
3691
  name: ["-t", "--times"],
3682
3692
  description: "Show time intervals on @done tasks",
@@ -4453,6 +4463,20 @@ const completionSpec: Fig.Spec = {
4453
4463
 
4454
4464
  },
4455
4465
 
4466
+ {
4467
+ name: "update",
4468
+ description: "Update doing to the latest version",
4469
+ options: [
4470
+ {
4471
+ name: ["--beta"],
4472
+ description: "Check for pre-release version",
4473
+
4474
+ },
4475
+
4476
+ ],
4477
+
4478
+ },
4479
+
4456
4480
  {
4457
4481
  name: "view",
4458
4482
  description: "Display a user-created view",
data/lib/doing/colors.rb CHANGED
@@ -109,7 +109,7 @@ module Doing
109
109
  compiled = ''
110
110
  normalize_color.split('').each do |char|
111
111
  compiled += char
112
- valid_color = compiled if Color.attributes.include?(compiled.to_sym)
112
+ valid_color = compiled if Color.attributes.include?(compiled.to_sym) || compiled =~ /^([fb]g?)?#([a-f0-9]{6})$/i
113
113
  end
114
114
 
115
115
  valid_color
@@ -225,6 +225,19 @@ module Doing
225
225
  module_eval(new_method)
226
226
  end
227
227
 
228
+ def rgb(hex)
229
+ is_bg = hex.match(/^bg?#/) ? true : false
230
+ hex_string = hex.sub(/^([fb]g?)?#/, '')
231
+
232
+ parts = hex_string.match(/(?<r>..)(?<g>..)(?<b>..)/)
233
+ t = []
234
+ %w[r g b].each do |e|
235
+ t << parts[e].hex
236
+ end
237
+ color =
238
+ "\e[#{is_bg ? '48' : '38'};2;#{t.join(';')}m"
239
+ end
240
+
228
241
  # Regular expression that is used to scan for ANSI-sequences while
229
242
  # uncoloring strings.
230
243
  COLORED_REGEXP = /\e\[(?:(?:[349]|10)[0-7]|[0-9])?m/.freeze
@@ -1,10 +1,21 @@
1
1
  module Doing
2
2
  module Completion
3
3
  module StringUtils
4
+
5
+ ##
6
+ ## Get short description for command completion
7
+ ##
8
+ ## @return [String] Short description
9
+ ##
4
10
  def short_desc
5
11
  split(/[,.]/)[0].sub(/ \(.*?\)?$/, '').strip
6
12
  end
7
13
 
14
+ ##
15
+ ## Truncate string from left
16
+ ##
17
+ ## @param max The maximum number of characters
18
+ ##
8
19
  def ltrunc(max)
9
20
  if length > max
10
21
  sub(/^.*?(.{#{max - 3}})$/, '...\1')
data/lib/doing/hash.rb CHANGED
@@ -70,6 +70,12 @@ module Doing
70
70
  end
71
71
  end
72
72
 
73
+ ##
74
+ ## Turn all non-numeric values into strings
75
+ ##
76
+ ## @return [Hash] a copy of the hash where all
77
+ ## non-numeric values are strings
78
+ ##
73
79
  def stringify_values
74
80
  transform_values do |v|
75
81
  if v.is_a?(Hash)
data/lib/doing/logger.rb CHANGED
@@ -258,7 +258,7 @@ module Doing
258
258
  results = @results.select { |msg| write_message?(msg[:level]) }.uniq
259
259
 
260
260
  if @logdev == $stdout
261
- $stdout.print results.map {|res| res[:message].uncolor }.join("\n")
261
+ $stdout.print results.map { |res| res[:message].uncolor }.join("\n")
262
262
  $stdout.puts
263
263
  else
264
264
  results.each do |msg|
@@ -324,7 +324,6 @@ module Doing
324
324
  end
325
325
  end
326
326
 
327
-
328
327
  def log_change(tags_added: [], tags_removed: [], count: 1, item: nil, single: false)
329
328
  if tags_added.empty? && tags_removed.empty?
330
329
  count(:skipped, level: :debug, message: '%count %items with no change', count: count)
@@ -348,9 +347,9 @@ module Doing
348
347
  if tags_removed.empty?
349
348
  count(:skipped, level: :debug, message: 'no tags removed from %count %items')
350
349
  elsif single && item
351
- added = tags_added.log_tags
350
+ removed = tags_removed.log_tags
352
351
  info('Untagged:',
353
- %(removed #{tags_removed.count == 1 ? 'tag' : 'tags'} #{added} from #{item.title}))
352
+ %(removed #{tags_removed.count == 1 ? 'tag' : 'tags'} #{removed} from #{item.title}))
354
353
  else
355
354
  count(:removed_tags, level: :info, tag: tags_removed, message: '%tags removed from %count %items')
356
355
  end
@@ -85,6 +85,11 @@ module Doing
85
85
  Regexp.new(pattern, !case_sensitive)
86
86
  end
87
87
 
88
+ ##
89
+ ## Returns a phrase query (elastic search) representation of the object as a phrase parser.
90
+ ##
91
+ ## @return Phrase query representation of the object.
92
+ ##
88
93
  def to_phrase_query
89
94
  parser = PhraseParser::QueryParser.new
90
95
  transformer = PhraseParser::QueryTransformer.new
@@ -92,6 +97,11 @@ module Doing
92
97
  transformer.apply(parse_tree).to_elasticsearch
93
98
  end
94
99
 
100
+ ##
101
+ ## Returns a query (elastic search) representation of the object as a boolean term parser.
102
+ ##
103
+ ## @return Query representation of the object.
104
+ ##
95
105
  def to_query
96
106
  parser = BooleanTermParser::QueryParser.new
97
107
  transformer = BooleanTermParser::QueryTransformer.new
@@ -65,12 +65,13 @@ module Doing
65
65
  working = dup
66
66
  color_array = []
67
67
 
68
- scan(/(?<!\\)(%([a-z]+))/).each do |color|
68
+ scan(/(?<!\\)(%((?:[fb]g?)?#[a-fA-F0-9]{6}|[a-z]+))/).each do |color|
69
69
  valid_color = color[1].validate_color
70
70
  next unless valid_color
71
71
 
72
72
  idx = working.match(/(?<!\\)%#{valid_color}/).begin(0)
73
- color_array.push({ name: valid_color, color: Color.send(valid_color), index: idx })
73
+ color = Color.attributes.include?(valid_color.to_sym) ? Color.send(valid_color) : Color.rgb(valid_color)
74
+ color_array.push({ name: valid_color, color: color, index: idx })
74
75
  working.sub!(/(?<!\\)%#{valid_color}/, '')
75
76
  end
76
77
 
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '2.1.57'
2
+ VERSION = '2.1.61'
3
3
  end
@@ -159,7 +159,6 @@ module Doing
159
159
  write(@doing_file)
160
160
  end
161
161
 
162
-
163
162
  ##
164
163
  ## Tag the last entry or X entries
165
164
  ##
@@ -281,6 +280,7 @@ module Doing
281
280
 
282
281
  if opt[:remove] || opt[:rename] || opt[:value]
283
282
  rename_to = nil
283
+
284
284
  if opt[:value]
285
285
  rename_to = tag
286
286
  elsif opt[:rename]
@@ -14,162 +14,7 @@ module Doing
14
14
  def tag_times(format: :text, sort_by: :time, sort_order: :asc)
15
15
  return '' if @timers.empty?
16
16
 
17
- max = @timers.keys.sort_by(&:length).reverse[0].length + 1
18
-
19
- total = @timers.delete('All')
20
-
21
- tags_data = @timers.delete_if { |_k, v| v.zero? }
22
- sorted_tags_data = if sort_by.normalize_tag_sort == :name
23
- tags_data.sort_by { |k, _v| k }
24
- else
25
- tags_data.sort_by { |_k, v| v }
26
- end
27
-
28
- sorted_tags_data.reverse! if sort_order.normalize_order == :asc
29
- case format
30
- when :html
31
-
32
- output = <<EOHEAD
33
- <table>
34
- <caption id="tagtotals">Tag Totals</caption>
35
- <colgroup>
36
- <col style="text-align:left;"/>
37
- <col style="text-align:left;"/>
38
- </colgroup>
39
- <thead>
40
- <tr>
41
- <th style="text-align:left;">project</th>
42
- <th style="text-align:left;">time</th>
43
- </tr>
44
- </thead>
45
- <tbody>
46
- EOHEAD
47
- sorted_tags_data.reverse.each do |k, v|
48
- if v.positive?
49
- output += "<tr><td style='text-align:left;'>#{k}</td><td style='text-align:left;'>#{v.time_string(format: :clock)}</td></tr>\n"
50
- end
51
- end
52
- tail = <<EOTAIL
53
- <tr>
54
- <td style="text-align:left;" colspan="2"></td>
55
- </tr>
56
- </tbody>
57
- <tfoot>
58
- <tr>
59
- <td style="text-align:left;"><strong>Total</strong></td>
60
- <td style="text-align:left;">#{total.time_string(format: :clock)}</td>
61
- </tr>
62
- </tfoot>
63
- </table>
64
- EOTAIL
65
- output + tail
66
- when :markdown
67
- pad = sorted_tags_data.map { |k, _| k }.group_by(&:size).max.last[0].length
68
- pad = 7 if pad < 7
69
- output = <<~EOHEADER
70
- | #{' ' * (pad - 7)}project | time |
71
- | #{'-' * (pad - 1)}: | :------- |
72
- EOHEADER
73
- sorted_tags_data.reverse.each do |k, v|
74
- if v.positive?
75
- output += "| #{' ' * (pad - k.length)}#{k} | #{v.time_string(format: :clock)} |\n"
76
- end
77
- end
78
- tail = '[Tag Totals]'
79
- output + tail
80
- when :json
81
- output = []
82
- sorted_tags_data.reverse.each do |k, v|
83
- output << {
84
- 'tag' => k,
85
- 'seconds' => v,
86
- 'formatted' => v.time_string(format: :clock)
87
- }
88
- end
89
- output
90
- when :human
91
- output = []
92
- sorted_tags_data.reverse.each do |k, v|
93
- spacer = ''
94
- (max - k.length).times do
95
- spacer += ' '
96
- end
97
- output.push("┃ #{spacer}#{k}:#{v.time_string(format: :hm)} ┃")
98
- end
99
-
100
- header = '┏━━ Tag Totals '
101
- (max - 2).times { header += '━' }
102
- header += '┓'
103
- footer = '┗'
104
- (max + 12).times { footer += '━' }
105
- footer += '┛'
106
- divider = '┣'
107
- (max + 12).times { divider += '━' }
108
- divider += '┫'
109
- output = output.empty? ? '' : "\n#{header}\n#{output.join("\n")}"
110
- output += "\n#{divider}"
111
- spacer = ''
112
- (max - 6).times do
113
- spacer += ' '
114
- end
115
- total_time = total.time_string(format: :hm)
116
- total = "┃ #{spacer}total: "
117
- total += total_time
118
- total += ' ┃'
119
- output += "\n#{total}"
120
- output += "\n#{footer}"
121
- output
122
- else
123
- output = []
124
- sorted_tags_data.reverse.each do |k, v|
125
- spacer = ''
126
- (max - k.length).times do
127
- spacer += ' '
128
- end
129
- output.push("#{k}:#{spacer}#{v.time_string(format: :clock)}")
130
- end
131
-
132
- output = output.empty? ? '' : "\n--- Tag Totals ---\n#{output.join("\n")}"
133
- output += "\n\nTotal tracked: #{total.time_string(format: :clock)}\n"
134
- output
135
- end
136
- end
137
-
138
- ##
139
- ## Gets the interval between entry's start
140
- ## date and @done date
141
- ##
142
- ## @param item [Item] The entry
143
- ## @param formatted [Boolean] Return human readable
144
- ## time (default seconds)
145
- ## @param record [Boolean] Add the interval to the
146
- ## total for each tag
147
- ##
148
- ## @return Interval in seconds, or [d, h, m] array if
149
- ## formatted is true. False if no end date or
150
- ## interval is 0
151
- ##
152
- def get_interval(item, formatted: true, record: true)
153
- if item.interval
154
- seconds = item.interval
155
- record_tag_times(item, seconds) if record
156
- return seconds.positive? ? seconds : false unless formatted
157
-
158
- return seconds.positive? ? seconds.time_string(format: :clock) : false
159
- end
160
-
161
- false
162
- end##
163
- ## Get total elapsed time for all tags in
164
- ## selection
165
- ##
166
- ## @param format [String] return format (html,
167
- ## json, or text)
168
- ## @param sort_by [Symbol] Sort by :name or :time
169
- ## @param sort_order [Symbol] The sort order (:asc or :desc)
170
- ##
171
- def tag_times(format: :text, sort_by: :time, sort_order: :asc)
172
- return '' if @timers.empty?
17
+ @timers.delete('meanwhile')
173
18
 
174
19
  max = @timers.keys.sort_by(&:length).reverse[0].length + 1
175
20
 
@@ -50,7 +50,7 @@ article > ul > li:hover {
50
50
  .date {
51
51
  color: #7d9ca2;
52
52
  font-size: 17px;
53
- padding: 15px 1ch 0 0;
53
+ padding: 3px 1ch 0 0;
54
54
  text-align: right;
55
55
  white-space: nowrap;
56
56
  transition: color .2s ease-in-out;
@@ -59,7 +59,7 @@ article > ul > li:hover {
59
59
  .entry {
60
60
  border-left: solid 1px #ccc;
61
61
  line-height: 1.2;
62
- padding: 10px 10px 10px 3ch;
62
+ padding: 2px 10px 2px 3ch;
63
63
  text-indent: -2ch;
64
64
  }
65
65
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doing
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.57
4
+ version: 2.1.61
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-26 00:00:00.000000000 Z
11
+ date: 2022-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github-markup
@@ -470,6 +470,7 @@ files:
470
470
  - bin/commands/template.rb
471
471
  - bin/commands/today.rb
472
472
  - bin/commands/undo.rb
473
+ - bin/commands/update.rb
473
474
  - bin/commands/view.rb
474
475
  - bin/commands/views.rb
475
476
  - bin/commands/yesterday.rb