doing 2.1.19 → 2.1.21

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 (84) hide show
  1. checksums.yaml +4 -4
  2. data/.yardoc/checksums +9 -8
  3. data/.yardoc/object_types +0 -0
  4. data/.yardoc/objects/root.dat +0 -0
  5. data/CHANGELOG.md +49 -0
  6. data/Gemfile.lock +11 -11
  7. data/README.md +1 -1
  8. data/Rakefile +10 -4
  9. data/bin/doing +123 -167
  10. data/docs/doc/Array.html +3 -3
  11. data/docs/doc/BooleanTermParser/Clause.html +3 -3
  12. data/docs/doc/BooleanTermParser/Operator.html +3 -3
  13. data/docs/doc/BooleanTermParser/Query.html +3 -3
  14. data/docs/doc/BooleanTermParser/QueryParser.html +3 -3
  15. data/docs/doc/BooleanTermParser/QueryTransformer.html +3 -3
  16. data/docs/doc/BooleanTermParser.html +3 -3
  17. data/docs/doc/Doing/Color.html +3 -3
  18. data/docs/doc/Doing/Completion.html +3 -3
  19. data/docs/doc/Doing/Configuration.html +4 -3
  20. data/docs/doc/Doing/Errors/DoingNoTraceError.html +3 -3
  21. data/docs/doc/Doing/Errors/DoingRuntimeError.html +3 -3
  22. data/docs/doc/Doing/Errors/DoingStandardError.html +3 -3
  23. data/docs/doc/Doing/Errors/EmptyInput.html +3 -3
  24. data/docs/doc/Doing/Errors/NoResults.html +3 -3
  25. data/docs/doc/Doing/Errors/PluginException.html +3 -3
  26. data/docs/doc/Doing/Errors/UserCancelled.html +3 -3
  27. data/docs/doc/Doing/Errors/WrongCommand.html +3 -3
  28. data/docs/doc/Doing/Errors.html +3 -3
  29. data/docs/doc/Doing/Hooks.html +3 -3
  30. data/docs/doc/Doing/Item.html +3 -3
  31. data/docs/doc/Doing/Items.html +3 -3
  32. data/docs/doc/Doing/LogAdapter.html +3 -3
  33. data/docs/doc/Doing/Note.html +3 -3
  34. data/docs/doc/Doing/Pager.html +3 -3
  35. data/docs/doc/Doing/Plugins.html +3 -3
  36. data/docs/doc/Doing/Prompt.html +3 -3
  37. data/docs/doc/Doing/Section.html +3 -3
  38. data/docs/doc/Doing/TemplateString.html +4 -4
  39. data/docs/doc/Doing/Util/Backup.html +3 -3
  40. data/docs/doc/Doing/Util.html +3 -3
  41. data/docs/doc/Doing/WWID.html +66 -8
  42. data/docs/doc/Doing.html +4 -4
  43. data/docs/doc/GLI/Commands/MarkdownDocumentListener.html +3 -3
  44. data/docs/doc/GLI/Commands.html +3 -3
  45. data/docs/doc/GLI.html +3 -3
  46. data/docs/doc/Hash.html +3 -3
  47. data/docs/doc/Numeric.html +3 -3
  48. data/docs/doc/PhraseParser/Operator.html +3 -3
  49. data/docs/doc/PhraseParser/PhraseClause.html +3 -3
  50. data/docs/doc/PhraseParser/Query.html +3 -3
  51. data/docs/doc/PhraseParser/QueryParser.html +3 -3
  52. data/docs/doc/PhraseParser/QueryTransformer.html +3 -3
  53. data/docs/doc/PhraseParser/TermClause.html +3 -3
  54. data/docs/doc/PhraseParser.html +3 -3
  55. data/docs/doc/Status.html +3 -3
  56. data/docs/doc/String.html +94 -17
  57. data/docs/doc/Symbol.html +3 -3
  58. data/docs/doc/Time.html +3 -3
  59. data/docs/doc/_index.html +4 -4
  60. data/docs/doc/file.README.html +4 -4
  61. data/docs/doc/frames.html +1 -1
  62. data/docs/doc/index.html +4 -4
  63. data/docs/doc/method_list.html +300 -276
  64. data/docs/doc/top-level-namespace.html +94 -3
  65. data/doing.gemspec +1 -1
  66. data/doing.rdoc +15 -6
  67. data/lib/completion/_doing.zsh +5 -5
  68. data/lib/completion/doing.bash +8 -8
  69. data/lib/completion/doing.fish +93 -15
  70. data/lib/doing/completion/fish_completion.rb +80 -11
  71. data/lib/doing/configuration.rb +1 -0
  72. data/lib/doing/hash.rb +1 -1
  73. data/lib/doing/items.rb +3 -1
  74. data/lib/doing/pager.rb +1 -1
  75. data/lib/doing/plugins/export/dayone_export.rb +1 -1
  76. data/lib/doing/plugins/export/markdown_export.rb +1 -1
  77. data/lib/doing/string.rb +11 -0
  78. data/lib/doing/string_chronify.rb +55 -17
  79. data/lib/doing/types.rb +19 -0
  80. data/lib/doing/version.rb +1 -1
  81. data/lib/doing/wwid.rb +69 -42
  82. data/lib/examples/commands/later.rb +32 -0
  83. data/lib/helpers/threaded_tests.rb +250 -0
  84. metadata +9 -6
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Top Level Namespace
8
8
 
9
- &mdash; Documentation by YARD 0.9.26
9
+ &mdash; Documentation by YARD 0.9.27
10
10
 
11
11
  </title>
12
12
 
@@ -91,6 +91,97 @@
91
91
 
92
92
  </p>
93
93
 
94
+
95
+ <h2>
96
+ Constant Summary
97
+ <small><a href="#" class="constants_summary_toggle">collapse</a></small>
98
+ </h2>
99
+
100
+ <dl class="constants">
101
+
102
+ <dt id="REGEX_BOOL-constant" class="">REGEX_BOOL =
103
+
104
+ </dt>
105
+ <dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$</span><span class='regexp_end'>/i</span></span></pre></dd>
106
+
107
+ <dt id="REGEX_SORT_ORDER-constant" class="">REGEX_SORT_ORDER =
108
+
109
+ </dt>
110
+ <dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^(?:a(?:sc)?|d(?:esc)?)$</span><span class='regexp_end'>/i</span></span></pre></dd>
111
+
112
+ <dt id="REGEX_VALUE_QUERY-constant" class="">REGEX_VALUE_QUERY =
113
+
114
+ </dt>
115
+ <dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^(?:!)?@?(?:\S+) +(?:!?[&lt;&gt;=][=*]?|[$*^]=) +(?:.*?)$</span><span class='regexp_end'>/</span></span></pre></dd>
116
+
117
+ <dt id="REGEX_CLOCK-constant" class="">REGEX_CLOCK =
118
+
119
+ </dt>
120
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>(?:\d{1,2}+(?::\d{1,2}+)?(?: *(?:am|pm))?|midnight|noon)</span><span class='tstring_end'>&#39;</span></span></pre></dd>
121
+
122
+ <dt id="REGEX_TIME-constant" class="">REGEX_TIME =
123
+
124
+ </dt>
125
+ <dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#REGEX_CLOCK-constant" title="REGEX_CLOCK (constant)">REGEX_CLOCK</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>$</span><span class='regexp_end'>/i</span></span></pre></dd>
126
+
127
+ <dt id="REGEX_DAY-constant" class="">REGEX_DAY =
128
+
129
+ </dt>
130
+ <dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^(mon|tue|wed|thur?|fri|sat|sun)(\w+(day)?)?$</span><span class='regexp_end'>/i</span></span></pre></dd>
131
+
132
+ <dt id="REGEX_RANGE_INDICATOR-constant" class="">REGEX_RANGE_INDICATOR =
133
+
134
+ </dt>
135
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'> +(?:to|through|thru|(?:un)?til|-+) +</span><span class='tstring_end'>&#39;</span></span></pre></dd>
136
+
137
+ <dt id="REGEX_RANGE-constant" class="">REGEX_RANGE =
138
+
139
+ </dt>
140
+ <dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\S+</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#REGEX_RANGE_INDICATOR-constant" title="REGEX_RANGE_INDICATOR (constant)">REGEX_RANGE_INDICATOR</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>+\S+</span><span class='regexp_end'>/i</span></span></pre></dd>
141
+
142
+ <dt id="REGEX_TIME_RANGE-constant" class="">REGEX_TIME_RANGE =
143
+
144
+ </dt>
145
+ <dd><pre class="code"><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#REGEX_CLOCK-constant" title="REGEX_CLOCK (constant)">REGEX_CLOCK</a></span></span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#REGEX_RANGE_INDICATOR-constant" title="REGEX_RANGE_INDICATOR (constant)">REGEX_RANGE_INDICATOR</a></span></span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#REGEX_CLOCK-constant" title="REGEX_CLOCK (constant)">REGEX_CLOCK</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>$</span><span class='regexp_end'>/i</span></span></pre></dd>
146
+
147
+ <dt id="InvalidExportType-constant" class="">InvalidExportType =
148
+
149
+ </dt>
150
+ <dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>RuntimeError</span><span class='rparen'>)</span></pre></dd>
151
+
152
+ <dt id="MissingConfigFile-constant" class="">MissingConfigFile =
153
+
154
+ </dt>
155
+ <dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>RuntimeError</span><span class='rparen'>)</span></pre></dd>
156
+
157
+ <dt id="TagArray-constant" class="">TagArray =
158
+
159
+ </dt>
160
+ <dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span></span><span class='rparen'>)</span></pre></dd>
161
+
162
+ <dt id="DateBeginString-constant" class="">DateBeginString =
163
+
164
+ </dt>
165
+ <dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>DateTime</span><span class='rparen'>)</span></pre></dd>
166
+
167
+ <dt id="DateEndString-constant" class="">DateEndString =
168
+
169
+ </dt>
170
+ <dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>DateTime</span><span class='rparen'>)</span></pre></dd>
171
+
172
+ <dt id="DateRangeString-constant" class="">DateRangeString =
173
+
174
+ </dt>
175
+ <dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span></span><span class='rparen'>)</span></pre></dd>
176
+
177
+ <dt id="DateIntervalString-constant" class="">DateIntervalString =
178
+
179
+ </dt>
180
+ <dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>DateTime</span><span class='rparen'>)</span></pre></dd>
181
+
182
+ </dl>
183
+
184
+
94
185
 
95
186
 
96
187
 
@@ -102,9 +193,9 @@
102
193
  </div>
103
194
 
104
195
  <div id="footer">
105
- Generated on Tue Jan 18 08:53:02 2022 by
196
+ Generated on Thu Jan 20 12:10:33 2022 by
106
197
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
107
- 0.9.26 (ruby-3.0.1).
198
+ 0.9.27 (ruby-3.0.1).
108
199
  </div>
109
200
 
110
201
  </div>
data/doing.gemspec CHANGED
@@ -33,7 +33,7 @@ spec = Gem::Specification.new do |s|
33
33
  s.add_development_dependency 'parallel_tests', '~> 3.7', '>= 3.7.3'
34
34
  s.add_development_dependency 'tty-spinner', '~> 0.9', '>= 0.9.3'
35
35
  s.add_runtime_dependency('tty-progressbar', '~> 0.18', '>= 0.18.2')
36
- s.add_runtime_dependency('gli', '~> 2.19', '>= 2.19.2')
36
+ s.add_runtime_dependency('gli', '~> 2.20', '>= 2.20.1')
37
37
  s.add_runtime_dependency('haml','~>5.0.0', '>= 5.0.0')
38
38
  s.add_runtime_dependency('chronic','~> 0.10', '>= 0.10.2')
39
39
  s.add_runtime_dependency('deep_merge', '~> 1.2', '>= 1.2.1')
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.19
8
+ v2.1.21
9
9
 
10
10
  === Global Options
11
11
  === --config_file arg
@@ -92,6 +92,13 @@ Repeat last entry as new entry
92
92
 
93
93
  This command is designed to allow multiple time intervals to be created for an entry by duplicating it with a new start (and end, eventually) time
94
94
  ===== Options
95
+ ===== -b|--back|--started DATE_STRING
96
+
97
+ Backdate start date by interval or set to time [4pm|20m|2h|"yesterday noon"]
98
+
99
+ [Default Value] None
100
+
101
+
95
102
  ===== --bool BOOLEAN
96
103
 
97
104
  Boolean used to combine multiple tags. Use PATTERN to parse + and - as booleans
@@ -549,6 +556,7 @@ Start and end times as a date/time range `doing done --from "1am to 8am"`.
549
556
  Overrides other date flags.
550
557
 
551
558
  [Default Value] None
559
+ [Must Match] (?i-mx:^\S+ +(?:to|through|thru|(?:un)?til|-+) ++\S+)
552
560
 
553
561
 
554
562
  ===== -n|--note TEXT
@@ -609,14 +617,14 @@ Mark last X entries as @done
609
617
 
610
618
  Marks the last X entries with a @done tag and current date. Does not alter already completed entries.
611
619
  ===== Options
612
- ===== --at DATE_STRING
620
+ ===== --at|--finished DATE_STRING
613
621
 
614
622
  Set finish date to specific date/time (natural langauge parsed, e.g. --at=1:30pm). If used, ignores --back.
615
623
 
616
624
  [Default Value] None
617
625
 
618
626
 
619
- ===== -b|--back DATE_STRING
627
+ ===== -b|--back|--started DATE_STRING
620
628
 
621
629
  Backdate completed date to date string [4pm|20m|2h|yesterday noon]
622
630
 
@@ -1039,7 +1047,7 @@ Add an item to the Later section
1039
1047
 
1040
1048
 
1041
1049
  ===== Options
1042
- ===== -b|--back DATE_STRING
1050
+ ===== -b|--back|--started DATE_STRING
1043
1051
 
1044
1052
  Backdate start time to date string [4pm|20m|2h|yesterday noon]
1045
1053
 
@@ -1165,7 +1173,7 @@ This command makes it easy to start and stop these overarching entries. Just run
1165
1173
  big project` to start a @meanwhile entry, add other entries as you work on the project, then use `doing meanwhile` by
1166
1174
  itself to mark the entry as @done.
1167
1175
  ===== Options
1168
- ===== -b|--back DATE_STRING
1176
+ ===== -b|--back|--started DATE_STRING
1169
1177
 
1170
1178
  Backdate start date for new entry to date string [4pm|20m|2h|yesterday noon]
1171
1179
 
@@ -2282,7 +2290,7 @@ View entries before specified time (e.g. 8am, 12:30pm, 15:00)
2282
2290
  [Default Value] None
2283
2291
 
2284
2292
 
2285
- ===== --from DATE_OR_RANGE
2293
+ ===== --from TIME_RANGE
2286
2294
 
2287
2295
  Time range to show `doing today --from "12pm to 4pm"`
2288
2296
 
@@ -2615,6 +2623,7 @@ View entries before specified time (e.g. 8am, 12:30pm, 15:00)
2615
2623
  Time range to show, e.g. `doing yesterday --from "1am to 8am"`
2616
2624
 
2617
2625
  [Default Value] None
2626
+ [Must Match] (?i-mx:^(?:\d{1,2}+(?::\d{1,2}+)?(?: *(?:am|pm))?|midnight|noon) +(?:to|through|thru|(?:un)?til|-+) +(?:\d{1,2}+(?::\d{1,2}+)?(?: *(?:am|pm))?|midnight|noon)$)
2618
2627
 
2619
2628
 
2620
2629
  ===== -o|--output FORMAT
@@ -70,10 +70,10 @@ function _doing() {
70
70
  args=( )
71
71
  ;;
72
72
  again)
73
- args=( "(--ask)--ask}[Prompt for note via multi-line input]" "(--bool=)--bool=}[Boolean used to combine multiple tags]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" {-e,--editor}"[Edit duplicated entry with vim before adding]" {-i,--interactive}"[Select item to resume from a menu of matching entries]" "(--in=)--in=}[Add new entry to section]" {-n,--note=}"[Add a note]" "(--not)--not}[Resume items that *dont* match search/tag filterst* match search/tag filters]" {-s,--section=}"[Get last entry from a specific section]" "(--search=)--search=}[Repeat last entry matching search]" "(--tag=)--tag=}[Repeat last entry matching tags]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact search string matching]" )
73
+ args=( "(--ask)--ask}[Prompt for note via multi-line input]" "(--started=)--started=}[Backdate start date by interval or set to time [4pm|20m|2h|"yesterday noon"]]" "(--bool=)--bool=}[Boolean used to combine multiple tags]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" {-e,--editor}"[Edit duplicated entry with vim before adding]" {-i,--interactive}"[Select item to resume from a menu of matching entries]" "(--in=)--in=}[Add new entry to section]" {-n,--note=}"[Add a note]" "(--not)--not}[Resume items that *dont* match search/tag filterst* match search/tag filters]" {-s,--section=}"[Get last entry from a specific section]" "(--search=)--search=}[Repeat last entry matching search]" "(--tag=)--tag=}[Repeat last entry matching tags]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact search string matching]" )
74
74
  ;;
75
75
  resume)
76
- args=( "(--ask)--ask}[Prompt for note via multi-line input]" "(--bool=)--bool=}[Boolean used to combine multiple tags]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" {-e,--editor}"[Edit duplicated entry with vim before adding]" {-i,--interactive}"[Select item to resume from a menu of matching entries]" "(--in=)--in=}[Add new entry to section]" {-n,--note=}"[Add a note]" "(--not)--not}[Resume items that *dont* match search/tag filterst* match search/tag filters]" {-s,--section=}"[Get last entry from a specific section]" "(--search=)--search=}[Repeat last entry matching search]" "(--tag=)--tag=}[Repeat last entry matching tags]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact search string matching]" )
76
+ args=( "(--ask)--ask}[Prompt for note via multi-line input]" "(--started=)--started=}[Backdate start date by interval or set to time [4pm|20m|2h|"yesterday noon"]]" "(--bool=)--bool=}[Boolean used to combine multiple tags]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" {-e,--editor}"[Edit duplicated entry with vim before adding]" {-i,--interactive}"[Select item to resume from a menu of matching entries]" "(--in=)--in=}[Add new entry to section]" {-n,--note=}"[Add a note]" "(--not)--not}[Resume items that *dont* match search/tag filterst* match search/tag filters]" {-s,--section=}"[Get last entry from a specific section]" "(--search=)--search=}[Repeat last entry matching search]" "(--tag=)--tag=}[Repeat last entry matching tags]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact search string matching]" )
77
77
  ;;
78
78
  archive)
79
79
  args=( "(--before=)--before=}[Archive entries older than date]" "(--bool=)--bool=}[Tag boolean]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" {-k,--keep=}"[How many items to keep]" "(--label)--label}[Label moved items with @from(SECTION_NAME)]" "(--not)--not}[Show items that *dont* match search stringt* match search string]" "(--search=)--search=}[Search filter]" {-t,--to=}"[Move entries to]" "(--tag=)--tag=}[Tag filter]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact search string matching]" )
@@ -112,7 +112,7 @@ function _doing() {
112
112
  args=( {-a,--archive}"[Immediately archive the entry]" "(--ask)--ask}[Prompt for note via multi-line input]" "(--finished=)--finished=}[Set finish date to specific date/time]" "(--started=)--started=}[Backdate start date by interval or set to time [4pm|20m|2h|"yesterday noon"]]" "(--date)--date}[Include date]" {-e,--editor}"[Edit entry with vim]" "(--from=)--from=}[Start and end times as a date/time range `doing done --from "1am to 8am"`]" {-n,--note=}"[Include a note]" {-r,--remove}"[Remove @done tag]" {-s,--section=}"[Section]" "(--for=)--for=}[Set completion date to start date plus interval]" {-u,--unfinished}"[Finish last entry not already marked @done]" )
113
113
  ;;
114
114
  finish)
115
- args=( {-a,--archive}"[Archive entries]" "(--at=)--at=}[Set finish date to specific date/time]" "(--auto)--auto}[Auto-generate finish dates from next entrys start times start time]" {-b,--back=}"[Backdate completed date to date string [4pm|20m|2h|yesterday noon]]" "(--bool=)--bool=}[Boolean]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" "(--date)--date}[Include date]" {-i,--interactive}"[Select item(s) to finish from a menu of matching entries]" "(--not)--not}[Finish items that *dont* match search/tag filterst* match search/tag filters]" {-r,--remove}"[Remove done tag]" {-s,--section=}"[Section]" "(--search=)--search=}[Finish the last X entries matching search filter]" "(--for=)--for=}[Set the completed date to the start date plus XX[hmd]]" "(--tag=)--tag=}[Finish the last X entries containing TAG]" {-u,--unfinished}"[Finish last entry]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact search string matching]" )
115
+ args=( {-a,--archive}"[Archive entries]" "(--finished=)--finished=}[Set finish date to specific date/time]" "(--auto)--auto}[Auto-generate finish dates from next entrys start times start time]" "(--started=)--started=}[Backdate completed date to date string [4pm|20m|2h|yesterday noon]]" "(--bool=)--bool=}[Boolean]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" "(--date)--date}[Include date]" {-i,--interactive}"[Select item(s) to finish from a menu of matching entries]" "(--not)--not}[Finish items that *dont* match search/tag filterst* match search/tag filters]" {-r,--remove}"[Remove done tag]" {-s,--section=}"[Section]" "(--search=)--search=}[Finish the last X entries matching search filter]" "(--for=)--for=}[Set the completed date to the start date plus XX[hmd]]" "(--tag=)--tag=}[Finish the last X entries containing TAG]" {-u,--unfinished}"[Finish last entry]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact search string matching]" )
116
116
  ;;
117
117
  grep)
118
118
  args=( "(--after=)--after=}[Search entries newer than date]" "(--before=)--before=}[Search entries older than date]" "(--bool=)--bool=}[Combine multiple tags or value queries using AND]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" {-d,--delete}"[Delete matching entries]" "(--duration)--duration}[Show elapsed time on entries without @done tag]" {-e,--editor}"[Edit matching entries with vim]" "(--from=)--from=}[Date range to show]" {-h,--hilite}"[Highlight search matches in output]" {-i,--interactive}"[Display an interactive menu of results to perform further operations]" "(--not)--not}[Show items that *dont* match search stringt* match search string]" {-o,--output=}"[Output to export format]" "(--only_timed)--only_timed}[Only show items with recorded time intervals]" {-s,--section=}"[Section]" {-t,--times}"[Show time intervals on @done tasks]" "(--tag_sort=)--tag_sort=}[Sort tags by]" "(--totals)--totals}[Show intervals with totals at the end of output]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact string matching]" )
@@ -130,7 +130,7 @@ function _doing() {
130
130
  args=( "(--bool=)--bool=}[Tag boolean]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" {-d,--delete}"[Delete the last entry]" "(--duration)--duration}[Show elapsed time if entry is not tagged @done]" {-e,--editor}"[Edit entry with vim]" {-h,--hilite}"[Highlight search matches in output]" "(--not)--not}[Show items that *dont* match search string or tag filtert* match search string or tag filter]" {-s,--section=}"[Specify a section]" "(--search=)--search=}[Search filter]" "(--tag=)--tag=}[Tag filter]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact search string matching]" )
131
131
  ;;
132
132
  later)
133
- args=( "(--ask)--ask}[Prompt for note via multi-line input]" {-b,--back=}"[Backdate start time to date string [4pm|20m|2h|yesterday noon]]" {-e,--editor}"[Edit entry with vim]" {-n,--note=}"[Note]" )
133
+ args=( "(--ask)--ask}[Prompt for note via multi-line input]" "(--started=)--started=}[Backdate start time to date string [4pm|20m|2h|yesterday noon]]" {-e,--editor}"[Edit entry with vim]" {-n,--note=}"[Note]" )
134
134
  ;;
135
135
  mark)
136
136
  args=( "(--bool=)--bool=}[Boolean]" {-c,--count=}"[How many recent entries to tag]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" {-d,--date}"[Include current date/time with tag]" "(--force)--force}[Dont ask permission to flag all entries when count is 0t ask permission to flag all entries when count is 0]" {-i,--interactive}"[Select item(s) to flag from a menu of matching entries]" "(--not)--not}[Flag items that *dont* match search/tag/date filterst* match search/tag/date filters]" {-r,--remove}"[Remove flag]" {-s,--section=}"[Section]" "(--search=)--search=}[Flag the last entry matching search filter]" "(--tag=)--tag=}[Flag the last entry containing TAG]" {-u,--unfinished}"[Flag last entry]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact search string matching]" )
@@ -139,7 +139,7 @@ function _doing() {
139
139
  args=( "(--bool=)--bool=}[Boolean]" {-c,--count=}"[How many recent entries to tag]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" {-d,--date}"[Include current date/time with tag]" "(--force)--force}[Dont ask permission to flag all entries when count is 0t ask permission to flag all entries when count is 0]" {-i,--interactive}"[Select item(s) to flag from a menu of matching entries]" "(--not)--not}[Flag items that *dont* match search/tag/date filterst* match search/tag/date filters]" {-r,--remove}"[Remove flag]" {-s,--section=}"[Section]" "(--search=)--search=}[Flag the last entry matching search filter]" "(--tag=)--tag=}[Flag the last entry containing TAG]" {-u,--unfinished}"[Flag last entry]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact search string matching]" )
140
140
  ;;
141
141
  meanwhile)
142
- args=( {-a,--archive}"[Archive previous @meanwhile entry]" "(--ask)--ask}[Prompt for note via multi-line input]" {-b,--back=}"[Backdate start date for new entry to date string [4pm|20m|2h|yesterday noon]]" {-e,--editor}"[Edit entry with vim]" {-n,--note=}"[Note]" {-s,--section=}"[Section]" )
142
+ args=( {-a,--archive}"[Archive previous @meanwhile entry]" "(--ask)--ask}[Prompt for note via multi-line input]" "(--started=)--started=}[Backdate start date for new entry to date string [4pm|20m|2h|yesterday noon]]" {-e,--editor}"[Edit entry with vim]" {-n,--note=}"[Note]" {-s,--section=}"[Section]" )
143
143
  ;;
144
144
  note)
145
145
  args=( "(--ask)--ask}[Prompt for note via multi-line input]" "(--bool=)--bool=}[Boolean]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" {-e,--editor}"[Edit entry with vim]" {-i,--interactive}"[Select item for new note from a menu of matching entries]" "(--not)--not}[Add note to item that *doesnt* match search/tag filterst* match search/tag filters]" {-r,--remove}"[Replace/Remove last entrys notes note]" {-s,--section=}"[Section]" "(--search=)--search=}[Add/remove note from last entry matching search filter]" "(--tag=)--tag=}[Add/remove note from last entry matching tag]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact search string matching]" )
@@ -1,9 +1,9 @@
1
1
  _doing_again() {
2
2
 
3
3
  if [[ "$token" == --* ]]; then
4
- COMPREPLY=( $( compgen -W '--ask --bool --case --editor --interactive --in --note --not --section --search --tag --val --exact' -- $token ) )
4
+ COMPREPLY=( $( compgen -W '--ask --started --bool --case --editor --interactive --in --note --not --section --search --tag --val --exact' -- $token ) )
5
5
  elif [[ "$token" == -* ]]; then
6
- COMPREPLY=( $( compgen -W '-e -i -n -s -x --ask --bool --case --editor --interactive --in --note --not --section --search --tag --val --exact' -- $token ) )
6
+ COMPREPLY=( $( compgen -W '-e -i -n -s -x --ask --started --bool --case --editor --interactive --in --note --not --section --search --tag --val --exact' -- $token ) )
7
7
 
8
8
  fi
9
9
  }
@@ -91,9 +91,9 @@ _doing_done() {
91
91
  _doing_finish() {
92
92
 
93
93
  if [[ "$token" == --* ]]; then
94
- COMPREPLY=( $( compgen -W '--archive --at --auto --back --bool --case --date --interactive --not --remove --section --search --for --tag --unfinished --val --exact' -- $token ) )
94
+ COMPREPLY=( $( compgen -W '--archive --finished --auto --started --bool --case --date --interactive --not --remove --section --search --for --tag --unfinished --val --exact' -- $token ) )
95
95
  elif [[ "$token" == -* ]]; then
96
- COMPREPLY=( $( compgen -W '-a -b -i -r -s -u -x --archive --at --auto --back --bool --case --date --interactive --not --remove --section --search --for --tag --unfinished --val --exact' -- $token ) )
96
+ COMPREPLY=( $( compgen -W '-a -i -r -s -u -x --archive --finished --auto --started --bool --case --date --interactive --not --remove --section --search --for --tag --unfinished --val --exact' -- $token ) )
97
97
 
98
98
  fi
99
99
  }
@@ -141,9 +141,9 @@ _doing_last() {
141
141
  _doing_later() {
142
142
 
143
143
  if [[ "$token" == --* ]]; then
144
- COMPREPLY=( $( compgen -W '--ask --back --editor --note' -- $token ) )
144
+ COMPREPLY=( $( compgen -W '--ask --started --editor --note' -- $token ) )
145
145
  elif [[ "$token" == -* ]]; then
146
- COMPREPLY=( $( compgen -W '-b -e -n --ask --back --editor --note' -- $token ) )
146
+ COMPREPLY=( $( compgen -W '-e -n --ask --started --editor --note' -- $token ) )
147
147
 
148
148
  fi
149
149
  }
@@ -161,9 +161,9 @@ _doing_mark() {
161
161
  _doing_meanwhile() {
162
162
 
163
163
  if [[ "$token" == --* ]]; then
164
- COMPREPLY=( $( compgen -W '--archive --ask --back --editor --note --section' -- $token ) )
164
+ COMPREPLY=( $( compgen -W '--archive --ask --started --editor --note --section' -- $token ) )
165
165
  elif [[ "$token" == -* ]]; then
166
- COMPREPLY=( $( compgen -W '-a -b -e -n -s --archive --ask --back --editor --note --section' -- $token ) )
166
+ COMPREPLY=( $( compgen -W '-a -e -n -s --archive --ask --started --editor --note --section' -- $token ) )
167
167
 
168
168
  fi
169
169
  }
@@ -23,28 +23,97 @@ function __fish_doing_using_command
23
23
  and return 0
24
24
  end
25
25
 
26
+ function __fish_doing_cache_timer_expired
27
+ set -l timer __fish_doing_cache_timer_$argv[1]
28
+ if not set -q $timer
29
+ set -g $timer (date '+%s')
30
+ end
31
+
32
+ if test (math (date '+%s') - $$timer) -gt $argv[2]
33
+ set -g $timer (date '+%s')
34
+ return 1
35
+ end
36
+
37
+ return 0
38
+ end
39
+
40
+ function __fish_doing_subcommands
41
+ if not set -q __fish_doing_subcommands_cache
42
+ or __fish_doing_cache_timer_expired subcommands 86400
43
+ set -g -a __fish_doing_subcommands_cache (doing help -c)
44
+ end
45
+ printf '%s
46
+ ' $__fish_doing_subcommands_cache
47
+ end
48
+
26
49
  function __fish_doing_complete_sections
27
- doing sections -c
50
+ if not set -q __fish_doing_sections_cache
51
+ or __fish_doing_cache_timer_expired sections 3600
52
+ set -g -a __fish_doing_sections_cache (doing sections -c)
53
+ end
54
+ printf '%s
55
+ ' $__fish_doing_sections_cache
56
+ __fish_doing_complete_show_tag
28
57
  end
29
58
 
30
59
  function __fish_doing_complete_views
31
- doing views -c
60
+ if not set -q __fish_doing_views_cache
61
+ or __fish_doing_cache_timer_expired views 3600
62
+ set -g -a __fish_doing_views_cache (doing views -c)
63
+ end
64
+ printf '%s
65
+ ' $__fish_doing_views_cache
32
66
  end
33
67
 
34
- function __fish_doing_subcommands
35
- doing help -c
68
+ function __fish_doing_export_plugin
69
+ if not set -q __fish_doing_export_plugin_cache
70
+ or __fish_doing_cache_timer_expired export_plugins 3600
71
+ set -g -a __fish_doing_export_plugin_cache (doing plugins --type export -c)
72
+ end
73
+ printf '%s
74
+ ' $__fish_doing_export_plugin_cache
75
+ end
76
+
77
+ function __fish_doing_import_plugin
78
+ if not set -q __fish_doing_import_plugin_cache
79
+ or __fish_doing_cache_timer_expired import_plugins 3600
80
+ set -g -a __fish_doing_import_plugin_cache (doing plugins --type import -c)
81
+ end
82
+ printf '%s
83
+ ' $__fish_doing_import_plugin_cache
84
+ end
85
+
86
+ function __fish_doing_complete_template
87
+ if not set -q __fish_doing_template_cache
88
+ or __fish_doing_cache_timer_expired template 3600
89
+ set -g -a __fish_doing_template_cache (doing template -c)
90
+ end
91
+ printf '%s
92
+ ' $__fish_doing_template_cache
36
93
  end
37
94
 
38
- function __fish_doing_export_plugins
39
- doing plugins --type export -c
95
+ function __fish_doing_complete_tag
96
+ if not set -q __fish_doing_tag_cache
97
+ or __fish_doing_cache_timer_expired tags 60
98
+ set -g -a __fish_doing_tag_cache (doing tags)
99
+ end
100
+ printf '%s
101
+ ' $__fish_doing_tag_cache
40
102
  end
41
103
 
42
- function __fish_doing_import_plugins
43
- doing plugins --type import -c
104
+ function __fish_doing_complete_show_tag
105
+ if not set -q __fish_doing_tag_cache
106
+ or __fish_doing_cache_timer_expired tags 60
107
+ set -g -a __fish_doing_tag_cache (doing tags)
108
+ end
109
+ printf '@%s
110
+ ' $__fish_doing_tag_cache
44
111
  end
45
112
 
46
- function __fish_doing_complete_templates
47
- doing template -c
113
+ function __fish_doing_complete_args
114
+ for cmd in (doing commands_accepting -c $argv[1])
115
+ complete -x -c doing -l $argv[1] -n "__fish_doing_using_command $cmd" -a "(__fish_doing_complete_$argv[1])"
116
+ end
48
117
  end
49
118
 
50
119
  complete -c doing -f
@@ -57,6 +126,14 @@ complete -f -c doing -s t -l type -x -n '__fish_doing_using_command import' -a '
57
126
 
58
127
  complete -xc doing -n '__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from (doing help -c)' -a "(doing help -c)"
59
128
 
129
+ function __fish_doing_complete_args
130
+ for cmd in (doing commands_accepting -c $argv[1])
131
+ complete -x -c doing -l $argv[1] -n "__fish_doing_using_command $cmd" -a "(__fish_doing_complete_$argv[1])"
132
+ end
133
+ end
134
+
135
+ __fish_doing_complete_args tag
136
+
60
137
  complete -xc doing -n '__fish_doing_needs_command' -a 'add_section' -d Add\ a\ new\ section\ to\ the\ \"doing\"\ file
61
138
  complete -xc doing -n '__fish_doing_needs_command' -a 'again resume' -d Repeat\ last\ entry\ as\ new\ entry
62
139
  complete -xc doing -n '__fish_doing_needs_command' -a 'archive move' -d Move\ entries\ between\ sections
@@ -100,6 +177,7 @@ complete -xc doing -n '__fish_doing_needs_command' -a 'views' -d List\ available
100
177
  complete -xc doing -n '__fish_doing_needs_command' -a 'wiki' -d Output\ a\ tag\ wiki
101
178
  complete -xc doing -n '__fish_doing_needs_command' -a 'yesterday' -d List\ entries\ from\ yesterday
102
179
  complete -c doing -l ask -f -n '__fish_doing_using_command again resume' -d Prompt\ for\ note\ via\ multi-line\ input
180
+ complete -c doing -l started -f -r -n '__fish_doing_using_command again resume' -d Backdate\ start\ date\ by\ interval\ or\ set\ to\ time\ \[4pm\|20m\|2h\|\"yesterday\ noon\"\]
103
181
  complete -c doing -l bool -f -r -n '__fish_doing_using_command again resume' -d Boolean\ used\ to\ combine\ multiple\ tags
104
182
  complete -c doing -l case -f -r -n '__fish_doing_using_command again resume' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
105
183
  complete -c doing -l editor -s e -f -n '__fish_doing_using_command again resume' -d Edit\ duplicated\ entry\ with\ vim\ before\ adding
@@ -159,9 +237,9 @@ complete -c doing -l section -s s -f -r -n '__fish_doing_using_command done did'
159
237
  complete -c doing -l for -f -r -n '__fish_doing_using_command done did' -d Set\ completion\ date\ to\ start\ date\ plus\ interval
160
238
  complete -c doing -l unfinished -s u -f -n '__fish_doing_using_command done did' -d Finish\ last\ entry\ not\ already\ marked\ @done
161
239
  complete -c doing -l archive -s a -f -n '__fish_doing_using_command finish' -d Archive\ entries
162
- complete -c doing -l at -f -r -n '__fish_doing_using_command finish' -d Set\ finish\ date\ to\ specific\ date/time
240
+ complete -c doing -l finished -f -r -n '__fish_doing_using_command finish' -d Set\ finish\ date\ to\ specific\ date/time
163
241
  complete -c doing -l auto -f -n '__fish_doing_using_command finish' -d Auto-generate\ finish\ dates\ from\ next\ entry\'s\ start\ time
164
- 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\]
242
+ complete -c doing -l started -f -r -n '__fish_doing_using_command finish' -d Backdate\ completed\ date\ to\ date\ string\ \[4pm\|20m\|2h\|yesterday\ noon\]
165
243
  complete -c doing -l bool -f -r -n '__fish_doing_using_command finish' -d Boolean
166
244
  complete -c doing -l case -f -r -n '__fish_doing_using_command finish' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
167
245
  complete -c doing -l date -f -n '__fish_doing_using_command finish' -d Include\ date
@@ -222,7 +300,7 @@ complete -c doing -l tag -f -r -n '__fish_doing_using_command last' -d Tag\ fil
222
300
  complete -c doing -l val -f -r -n '__fish_doing_using_command last' -d Perform\ a\ tag\ value\ query
223
301
  complete -c doing -l exact -s x -f -n '__fish_doing_using_command last' -d Force\ exact\ search\ string\ matching
224
302
  complete -c doing -l ask -f -n '__fish_doing_using_command later' -d Prompt\ for\ note\ via\ multi-line\ input
225
- 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\]
303
+ complete -c doing -l started -f -r -n '__fish_doing_using_command later' -d Backdate\ start\ time\ to\ date\ string\ \[4pm\|20m\|2h\|yesterday\ noon\]
226
304
  complete -c doing -l editor -s e -f -n '__fish_doing_using_command later' -d Edit\ entry\ with\ vim
227
305
  complete -c doing -l note -s n -f -r -n '__fish_doing_using_command later' -d Note
228
306
  complete -c doing -l bool -f -r -n '__fish_doing_using_command mark flag' -d Boolean
@@ -241,7 +319,7 @@ complete -c doing -l val -f -r -n '__fish_doing_using_command mark flag' -d Per
241
319
  complete -c doing -l exact -s x -f -n '__fish_doing_using_command mark flag' -d Force\ exact\ search\ string\ matching
242
320
  complete -c doing -l archive -s a -f -n '__fish_doing_using_command meanwhile' -d Archive\ previous\ @meanwhile\ entry
243
321
  complete -c doing -l ask -f -n '__fish_doing_using_command meanwhile' -d Prompt\ for\ note\ via\ multi-line\ input
244
- 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\]
322
+ complete -c doing -l started -f -r -n '__fish_doing_using_command meanwhile' -d Backdate\ start\ date\ for\ new\ entry\ to\ date\ string\ \[4pm\|20m\|2h\|yesterday\ noon\]
245
323
  complete -c doing -l editor -s e -f -n '__fish_doing_using_command meanwhile' -d Edit\ entry\ with\ vim
246
324
  complete -c doing -l note -s n -f -r -n '__fish_doing_using_command meanwhile' -d Note
247
325
  complete -c doing -l section -s s -f -r -n '__fish_doing_using_command meanwhile' -d Section
@@ -444,7 +522,7 @@ complete -c doing -l times -s t -f -n '__fish_doing_using_command yesterday' -d
444
522
  complete -c doing -l tag_order -f -r -n '__fish_doing_using_command yesterday' -d Tag\ sort\ direction
445
523
  complete -c doing -l tag_sort -f -r -n '__fish_doing_using_command yesterday' -d Sort\ tags\ by
446
524
  complete -c doing -l totals -f -n '__fish_doing_using_command yesterday' -d Show\ time\ totals\ at\ the\ end\ of\ output
447
- 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)'
525
+ 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_plugin)'
448
526
  complete -f -c doing -s b -l bool -x -n '__fish_doing_using_command again resume archive move autotag cancel finish grep search last mark flag note reset begin rotate show tag tags view wiki' -a 'and or not pattern'
449
527
  complete -f -c doing -l case -x -n '__fish_doing_using_command again resume archive move cancel finish grep search import last mark flag note reset begin rotate select show show tag tags tags view' -a 'case-sensitive ignore smart'
450
528
  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'
@@ -31,28 +31,89 @@ module Doing
31
31
  and return 0
32
32
  end
33
33
 
34
+ function __fish_doing_cache_timer_expired
35
+ set -l timer __fish_doing_cache_timer_$argv[1]
36
+ if not set -q $timer
37
+ set -g $timer (date '+%s')
38
+ end
39
+
40
+ if test (math (date '+%s') - $$timer) -gt $argv[2]
41
+ set -g $timer (date '+%s')
42
+ return 1
43
+ end
44
+
45
+ return 0
46
+ end
47
+
48
+ function __fish_doing_subcommands
49
+ if not set -q __fish_doing_subcommands_cache
50
+ or __fish_doing_cache_timer_expired subcommands 86400
51
+ set -g -a __fish_doing_subcommands_cache (doing help -c)
52
+ end
53
+ printf '%s\n' $__fish_doing_subcommands_cache
54
+ end
55
+
34
56
  function __fish_doing_complete_sections
35
- doing sections -c
57
+ if not set -q __fish_doing_sections_cache
58
+ or __fish_doing_cache_timer_expired sections 3600
59
+ set -g -a __fish_doing_sections_cache (doing sections -c)
60
+ end
61
+ printf '%s\n' $__fish_doing_sections_cache
62
+ __fish_doing_complete_show_tag
36
63
  end
37
64
 
38
65
  function __fish_doing_complete_views
39
- doing views -c
66
+ if not set -q __fish_doing_views_cache
67
+ or __fish_doing_cache_timer_expired views 3600
68
+ set -g -a __fish_doing_views_cache (doing views -c)
69
+ end
70
+ printf '%s\n' $__fish_doing_views_cache
40
71
  end
41
72
 
42
- function __fish_doing_subcommands
43
- doing help -c
73
+ function __fish_doing_export_plugin
74
+ if not set -q __fish_doing_export_plugin_cache
75
+ or __fish_doing_cache_timer_expired export_plugins 3600
76
+ set -g -a __fish_doing_export_plugin_cache (doing plugins --type export -c)
77
+ end
78
+ printf '%s\n' $__fish_doing_export_plugin_cache
79
+ end
80
+
81
+ function __fish_doing_import_plugin
82
+ if not set -q __fish_doing_import_plugin_cache
83
+ or __fish_doing_cache_timer_expired import_plugins 3600
84
+ set -g -a __fish_doing_import_plugin_cache (doing plugins --type import -c)
85
+ end
86
+ printf '%s\n' $__fish_doing_import_plugin_cache
87
+ end
88
+
89
+ function __fish_doing_complete_template
90
+ if not set -q __fish_doing_template_cache
91
+ or __fish_doing_cache_timer_expired template 3600
92
+ set -g -a __fish_doing_template_cache (doing template -c)
93
+ end
94
+ printf '%s\n' $__fish_doing_template_cache
44
95
  end
45
96
 
46
- function __fish_doing_export_plugins
47
- doing plugins --type export -c
97
+ function __fish_doing_complete_tag
98
+ if not set -q __fish_doing_tag_cache
99
+ or __fish_doing_cache_timer_expired tags 60
100
+ set -g -a __fish_doing_tag_cache (doing tags)
101
+ end
102
+ printf '%s\n' $__fish_doing_tag_cache
48
103
  end
49
104
 
50
- function __fish_doing_import_plugins
51
- doing plugins --type import -c
105
+ function __fish_doing_complete_show_tag
106
+ if not set -q __fish_doing_tag_cache
107
+ or __fish_doing_cache_timer_expired tags 60
108
+ set -g -a __fish_doing_tag_cache (doing tags)
109
+ end
110
+ printf '@%s\n' $__fish_doing_tag_cache
52
111
  end
53
112
 
54
- function __fish_doing_complete_templates
55
- doing template -c
113
+ function __fish_doing_complete_args
114
+ for cmd in (doing commands_accepting -c $argv[1])
115
+ complete -x -c doing -l $argv[1] -n "__fish_doing_using_command $cmd" -a "(__fish_doing_complete_$argv[1])"
116
+ end
56
117
  end
57
118
 
58
119
  complete -c doing -f
@@ -64,6 +125,14 @@ module Doing
64
125
  complete -f -c doing -s t -l type -x -n '__fish_doing_using_command import' -a '(__fish_doing_import_plugins)'
65
126
 
66
127
  complete -xc doing -n '__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from (doing help -c)' -a "(doing help -c)"
128
+
129
+ function __fish_doing_complete_args
130
+ for cmd in (doing commands_accepting -c $argv[1])
131
+ complete -x -c doing -l $argv[1] -n "__fish_doing_using_command $cmd" -a "(__fish_doing_complete_$argv[1])"
132
+ end
133
+ end
134
+
135
+ __fish_doing_complete_args tag
67
136
  EOFUNCTIONS
68
137
  end
69
138
 
@@ -161,7 +230,7 @@ module Doing
161
230
  end
162
231
 
163
232
  unless need_export.empty?
164
- out << "complete -f -c doing -s o -l output -x -n '__fish_doing_using_command #{need_export.join(' ')}' -a '(__fish_doing_export_plugins)'"
233
+ out << "complete -f -c doing -s o -l output -x -n '__fish_doing_using_command #{need_export.join(' ')}' -a '(__fish_doing_export_plugin)'"
165
234
  end
166
235
 
167
236
  unless need_bool.empty?
@@ -30,6 +30,7 @@ module Doing
30
30
  'command_path' => File.join(Util.user_home, '.config', 'doing', 'commands')
31
31
  },
32
32
  'doing_file' => '~/.local/share/doing/what_was_i_doing.md',
33
+ 'doing_file_sort' => 'desc',
33
34
  'backup_dir' => '~/.local/share/doing/doing_backup',
34
35
  'history_size' => 15,
35
36
  'current_section' => 'Currently',
data/lib/doing/hash.rb CHANGED
@@ -38,7 +38,7 @@ module Doing
38
38
  #
39
39
  def deep_set(path, value)
40
40
  if path.count == 1
41
- if value
41
+ unless value.nil? || value =~ /^ *$/
42
42
  self[path[0]] = value
43
43
  else
44
44
  delete(path[0])