doing 2.1.3 → 2.1.4pre
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.
- checksums.yaml +4 -4
- data/.yardoc/checksums +13 -10
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/CHANGELOG.md +27 -0
- data/Gemfile.lock +23 -1
- data/README.md +1 -1
- data/bin/doing +253 -63
- data/doc/Array.html +1 -1
- data/doc/Doing/Color.html +1 -1
- data/doc/Doing/Completion.html +1 -1
- data/doc/Doing/Configuration.html +42 -1
- data/doc/Doing/Errors/DoingNoTraceError.html +1 -1
- data/doc/Doing/Errors/DoingRuntimeError.html +1 -1
- data/doc/Doing/Errors/DoingStandardError.html +1 -1
- data/doc/Doing/Errors/EmptyInput.html +1 -1
- data/doc/Doing/Errors/NoResults.html +1 -1
- data/doc/Doing/Errors/PluginException.html +1 -1
- data/doc/Doing/Errors/UserCancelled.html +1 -1
- data/doc/Doing/Errors/WrongCommand.html +1 -1
- data/doc/Doing/Errors.html +1 -1
- data/doc/Doing/Hooks.html +1 -1
- data/doc/Doing/Item.html +37 -3
- data/doc/Doing/Items.html +35 -1
- data/doc/Doing/LogAdapter.html +1 -1
- data/doc/Doing/Note.html +1 -1
- data/doc/Doing/Pager.html +1 -1
- data/doc/Doing/Plugins.html +1 -1
- data/doc/Doing/Prompt.html +35 -1
- data/doc/Doing/Section.html +1 -1
- data/doc/Doing/Util.html +16 -4
- data/doc/Doing/WWID.html +131 -71
- data/doc/Doing.html +3 -3
- data/doc/GLI/Commands/MarkdownDocumentListener.html +1 -1
- data/doc/GLI/Commands.html +1 -1
- data/doc/GLI.html +1 -1
- data/doc/Hash.html +1 -1
- data/doc/Status.html +1 -1
- data/doc/String.html +104 -2
- data/doc/Symbol.html +1 -1
- data/doc/Time.html +70 -2
- data/doc/_index.html +125 -4
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +2 -2
- data/doc/index.html +2 -2
- data/doc/method_list.html +480 -144
- data/doc/top-level-namespace.html +2 -2
- data/doing.gemspec +2 -0
- data/doing.rdoc +155 -66
- data/lib/doing/boolean_term_parser.rb +86 -0
- data/lib/doing/configuration.rb +13 -4
- data/lib/doing/item.rb +94 -8
- data/lib/doing/items.rb +6 -0
- data/lib/doing/phrase_parser.rb +124 -0
- data/lib/doing/prompt.rb +8 -0
- data/lib/doing/string.rb +16 -2
- data/lib/doing/string_chronify.rb +5 -1
- data/lib/doing/time.rb +32 -0
- data/lib/doing/util.rb +2 -5
- data/lib/doing/util_backup.rb +235 -0
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +81 -26
- data/lib/doing.rb +6 -0
- metadata +47 -4
@@ -82,7 +82,7 @@
|
|
82
82
|
<p class="children">
|
83
83
|
|
84
84
|
|
85
|
-
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Doing.html" title="Doing (module)">Doing</a></span>, <span class='object_link'><a href="GLI.html" title="GLI (module)">GLI</a></span>, <span class='object_link'><a href="Status.html" title="Status (module)">Status</a></span>
|
85
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="BooleanTermParser.html" title="BooleanTermParser (module)">BooleanTermParser</a></span>, <span class='object_link'><a href="Doing.html" title="Doing (module)">Doing</a></span>, <span class='object_link'><a href="GLI.html" title="GLI (module)">GLI</a></span>, <span class='object_link'><a href="PhraseParser.html" title="PhraseParser (module)">PhraseParser</a></span>, <span class='object_link'><a href="Status.html" title="Status (module)">Status</a></span>
|
86
86
|
|
87
87
|
|
88
88
|
|
@@ -102,7 +102,7 @@
|
|
102
102
|
</div>
|
103
103
|
|
104
104
|
<div id="footer">
|
105
|
-
Generated on
|
105
|
+
Generated on Fri Dec 17 16:17:18 2021 by
|
106
106
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
107
107
|
0.9.26 (ruby-3.0.1).
|
108
108
|
</div>
|
data/doing.gemspec
CHANGED
@@ -39,5 +39,7 @@ spec = Gem::Specification.new do |s|
|
|
39
39
|
s.add_runtime_dependency('deep_merge', '~> 1.2', '>= 1.2.1')
|
40
40
|
s.add_runtime_dependency('tty-link', '~> 0.1', '>= 0.1.1')
|
41
41
|
s.add_runtime_dependency('tty-which', '~> 0.5', '>= 0.5.0')
|
42
|
+
s.add_runtime_dependency('tty-markdown', '~> 0.7', '>= 0.7.0')
|
43
|
+
s.add_runtime_dependency('parslet', '~> 2.0', '>= 2.0.0')
|
42
44
|
# s.add_runtime_dependency('amatch', '~> 0.4', '>= 0.4.0')
|
43
45
|
end
|
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.
|
8
|
+
v2.1.4pre
|
9
9
|
|
10
10
|
=== Global Options
|
11
11
|
=== --config_file arg
|
@@ -90,14 +90,14 @@ Add a new section to the "doing" file
|
|
90
90
|
==== Command: <tt>again|resume </tt>
|
91
91
|
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
95
|
===== --bool BOOLEAN
|
96
96
|
|
97
|
-
Boolean used to combine multiple tags
|
97
|
+
Boolean used to combine multiple tags. Use PATTERN to parse + and - as booleans.
|
98
98
|
|
99
|
-
[Default Value]
|
100
|
-
[Must Match] (?i-mx:^(?:and|all|any|or|not|none)$)
|
99
|
+
[Default Value] PATTERN
|
100
|
+
[Must Match] (?i-mx:^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$)
|
101
101
|
|
102
102
|
|
103
103
|
===== --case TYPE
|
@@ -139,7 +139,7 @@ Repeat last entry matching search. Surround with
|
|
139
139
|
|
140
140
|
===== --tag TAG
|
141
141
|
|
142
|
-
Repeat last entry matching tags. Combine multiple tags with a comma.
|
142
|
+
Repeat last entry matching tags. Combine multiple tags with a comma. Wildcards allowed (*, ?).
|
143
143
|
|
144
144
|
[Default Value] None
|
145
145
|
|
@@ -182,10 +182,10 @@ Archive entries older than date
|
|
182
182
|
|
183
183
|
===== --bool BOOLEAN
|
184
184
|
|
185
|
-
Tag boolean (AND|OR|NOT)
|
185
|
+
Tag boolean (AND|OR|NOT). Use PATTERN to parse + and - as booleans.
|
186
186
|
|
187
|
-
[Default Value]
|
188
|
-
[Must Match] (?i-mx:^(?:and|all|any|or|not|none)$)
|
187
|
+
[Default Value] PATTERN
|
188
|
+
[Must Match] (?i-mx:^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$)
|
189
189
|
|
190
190
|
|
191
191
|
===== --case TYPE
|
@@ -220,7 +220,7 @@ Move entries to
|
|
220
220
|
|
221
221
|
===== --tag TAG
|
222
222
|
|
223
|
-
Tag filter, combine multiple tags with a comma. Added for compatibility with other commands.
|
223
|
+
Tag filter, combine multiple tags with a comma. Wildcards allowed (*, ?). Added for compatibility with other commands.
|
224
224
|
|
225
225
|
[Default Value] None
|
226
226
|
|
@@ -250,7 +250,7 @@ Autotag last entry or filtered entries
|
|
250
250
|
Boolean (AND|OR|NOT) with which to combine multiple tag filters
|
251
251
|
|
252
252
|
[Default Value] AND
|
253
|
-
[Must Match] (?i-mx:^(?:and|all|any|or|not|none)$)
|
253
|
+
[Must Match] (?i-mx:^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$)
|
254
254
|
|
255
255
|
|
256
256
|
===== -c|--count COUNT
|
@@ -307,10 +307,10 @@ Adds @done tag without datestamp so no elapsed time is recorded. Alias for `doin
|
|
307
307
|
===== Options
|
308
308
|
===== --bool BOOLEAN
|
309
309
|
|
310
|
-
Boolean (AND|OR|NOT) with which to combine multiple tag filters
|
310
|
+
Boolean (AND|OR|NOT) with which to combine multiple tag filters. Use PATTERN to parse + and - as booleans.
|
311
311
|
|
312
|
-
[Default Value]
|
313
|
-
[Must Match] (?i-mx:^(?:and|all|any|or|not|none)$)
|
312
|
+
[Default Value] PATTERN
|
313
|
+
[Must Match] (?i-mx:^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$)
|
314
314
|
|
315
315
|
|
316
316
|
===== --case TYPE
|
@@ -337,7 +337,7 @@ Cancel the last X entries matching search filter, surround with slashes for rege
|
|
337
337
|
|
338
338
|
===== --tag TAG
|
339
339
|
|
340
|
-
Cancel the last X entries containing TAG. Separate multiple tags with comma (--tag=tag1,tag2)
|
340
|
+
Cancel the last X entries containing TAG. Separate multiple tags with comma (--tag=tag1,tag2). Wildcards allowed (*, ?).
|
341
341
|
|
342
342
|
[Default Value] None
|
343
343
|
|
@@ -367,6 +367,10 @@ Force exact search string matching (case sensitive)
|
|
367
367
|
|
368
368
|
|
369
369
|
|
370
|
+
==== Command: <tt>changelog|changes </tt>
|
371
|
+
List recent changes in Doing
|
372
|
+
|
373
|
+
Display a formatted list of changes in recent versions, latest at the top
|
370
374
|
==== Command: <tt>choose </tt>
|
371
375
|
Select a section to display from a menu
|
372
376
|
|
@@ -376,7 +380,8 @@ List available color variables for configuration templates and views
|
|
376
380
|
|
377
381
|
|
378
382
|
==== Command: <tt>completion </tt>
|
379
|
-
|
383
|
+
Generates the necessary scripts to add command line completion to various shells, so typing 'doing' and hitting
|
384
|
+
tab will offer completions of subcommands and their options.
|
380
385
|
|
381
386
|
|
382
387
|
===== Options
|
@@ -488,7 +493,9 @@ Update default config file, adding any missing keys
|
|
488
493
|
|
489
494
|
[Default Command] edit
|
490
495
|
==== Command: <tt>done|did ENTRY</tt>
|
491
|
-
|
496
|
+
Use this command to add an entry after you've already finished it. It will be immediately marked as @done.
|
497
|
+
You can modify the start and end times of the entry using the --back, --took, and --at flags, making it an easy
|
498
|
+
way to add entries in post and maintain accurate (albeit manual) time tracking.
|
492
499
|
|
493
500
|
|
494
501
|
===== Options
|
@@ -576,10 +583,10 @@ Backdate completed date to date string [4pm|20m|2h|yesterday noon]
|
|
576
583
|
|
577
584
|
===== --bool BOOLEAN
|
578
585
|
|
579
|
-
Boolean (AND|OR|NOT) with which to combine multiple tag filters
|
586
|
+
Boolean (AND|OR|NOT) with which to combine multiple tag filters. Use PATTERN to parse + and - as booleans.
|
580
587
|
|
581
|
-
[Default Value]
|
582
|
-
[Must Match] (?i-mx:^(?:and|all|any|or|not|none)$)
|
588
|
+
[Default Value] PATTERN
|
589
|
+
[Must Match] (?i-mx:^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$)
|
583
590
|
|
584
591
|
|
585
592
|
===== --case TYPE
|
@@ -614,7 +621,7 @@ Set the completed date to the start date plus XX[hmd]
|
|
614
621
|
===== --tag TAG
|
615
622
|
|
616
623
|
Finish the last X entries containing TAG.
|
617
|
-
Separate multiple tags with comma (--tag=tag1,tag2), combine with --bool
|
624
|
+
Separate multiple tags with comma (--tag=tag1,tag2), combine with --bool. Wildcards allowed (*, ?).
|
618
625
|
|
619
626
|
[Default Value] None
|
620
627
|
|
@@ -666,7 +673,7 @@ Search for entries
|
|
666
673
|
|
667
674
|
Search all sections (or limit to a single section) for entries matching text or regular expression. Normal strings are fuzzy matched.
|
668
675
|
|
669
|
-
To search with regular expressions, single quote the string and surround with slashes: `doing search '
|
676
|
+
To search with regular expressions, single quote the string and surround with slashes: `doing search '/m.*?x/'`
|
670
677
|
===== Options
|
671
678
|
===== --after DATE_STRING
|
672
679
|
|
@@ -868,14 +875,15 @@ Force exact search string matching (case sensitive)
|
|
868
875
|
==== Command: <tt>last </tt>
|
869
876
|
Show the last entry, optionally edit
|
870
877
|
|
871
|
-
|
878
|
+
Shows the last entry. Using --search and --tag filters, you can view/edit the last entry matching a filter,
|
879
|
+
allowing `doing last` to target historical entries.
|
872
880
|
===== Options
|
873
881
|
===== --bool BOOLEAN
|
874
882
|
|
875
|
-
Tag boolean
|
883
|
+
Tag boolean (AND|OR|NOT). Use PATTERN to parse + and - as booleans.
|
876
884
|
|
877
|
-
[Default Value]
|
878
|
-
[Must Match] (?i-mx:^(?:and|all|any|or|not|none)$)
|
885
|
+
[Default Value] PATTERN
|
886
|
+
[Must Match] (?i-mx:^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$)
|
879
887
|
|
880
888
|
|
881
889
|
===== --case TYPE
|
@@ -902,7 +910,7 @@ Search filter, surround with slashes for regex (/query/), start with single quot
|
|
902
910
|
|
903
911
|
===== --tag TAG
|
904
912
|
|
905
|
-
Tag filter, combine multiple tags with a comma.
|
913
|
+
Tag filter, combine multiple tags with a comma. Wildcards allowed (*, ?).
|
906
914
|
|
907
915
|
[Default Value] None
|
908
916
|
|
@@ -958,10 +966,10 @@ Mark last entry as flagged
|
|
958
966
|
===== Options
|
959
967
|
===== --bool BOOLEAN
|
960
968
|
|
961
|
-
Boolean (AND|OR|NOT) with which to combine multiple tag filters
|
969
|
+
Boolean (AND|OR|NOT) with which to combine multiple tag filters. Use PATTERN to parse + and - as booleans.
|
962
970
|
|
963
|
-
[Default Value]
|
964
|
-
[Must Match] (?i-mx:^(?:and|all|any|or|not|none)$)
|
971
|
+
[Default Value] PATTERN
|
972
|
+
[Must Match] (?i-mx:^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$)
|
965
973
|
|
966
974
|
|
967
975
|
===== -c|--count COUNT
|
@@ -997,7 +1005,7 @@ Flag the last entry matching search filter, surround with slashes for regex (e.g
|
|
997
1005
|
===== --tag TAG
|
998
1006
|
|
999
1007
|
Flag the last entry containing TAG.
|
1000
|
-
Separate multiple tags with comma (--tag=tag1,tag2), combine with --bool
|
1008
|
+
Separate multiple tags with comma (--tag=tag1,tag2), combine with --bool. Wildcards allowed (*, ?).
|
1001
1009
|
|
1002
1010
|
[Default Value] None
|
1003
1011
|
|
@@ -1040,7 +1048,10 @@ Force exact search string matching (case sensitive)
|
|
1040
1048
|
==== Command: <tt>meanwhile ENTRY</tt>
|
1041
1049
|
Finish any running @meanwhile tasks and optionally create a new one
|
1042
1050
|
|
1043
|
-
|
1051
|
+
The @meanwhile tag allows you to have long-running entries that encompass smaller entries.
|
1052
|
+
This command makes it easy to start and stop these overarching entries. Just run `doing meanwhile Starting work on this
|
1053
|
+
big project` to start a @meanwhile entry, add other entries as you work on the project, then use `doing meanwhile` by
|
1054
|
+
itself to mark the entry as @done.
|
1044
1055
|
===== Options
|
1045
1056
|
===== -b|--back DATE_STRING
|
1046
1057
|
|
@@ -1084,10 +1095,10 @@ If -r is provided with no other arguments, the last note is removed.
|
|
1084
1095
|
===== Options
|
1085
1096
|
===== --bool BOOLEAN
|
1086
1097
|
|
1087
|
-
Boolean (AND|OR|NOT) with which to combine multiple tag filters
|
1098
|
+
Boolean (AND|OR|NOT) with which to combine multiple tag filters. Use PATTERN to parse + and - as booleans.
|
1088
1099
|
|
1089
|
-
[Default Value]
|
1090
|
-
[Must Match] (?i-mx:^(?:and|all|any|or|not|none)$)
|
1100
|
+
[Default Value] PATTERN
|
1101
|
+
[Must Match] (?i-mx:^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$)
|
1091
1102
|
|
1092
1103
|
|
1093
1104
|
===== --case TYPE
|
@@ -1114,7 +1125,7 @@ Add/remove note from last entry matching search filter, surround with slashes fo
|
|
1114
1125
|
|
1115
1126
|
===== --tag TAG
|
1116
1127
|
|
1117
|
-
Add/remove note from last entry matching tag
|
1128
|
+
Add/remove note from last entry matching tag. Wildcards allowed (*, ?).
|
1118
1129
|
|
1119
1130
|
[Default Value] None
|
1120
1131
|
|
@@ -1231,7 +1242,8 @@ Show time totals at the end of output
|
|
1231
1242
|
==== Command: <tt>open </tt>
|
1232
1243
|
Open the "doing" file in an editor
|
1233
1244
|
|
1234
|
-
`doing open` defaults to using the
|
1245
|
+
`doing open` defaults to using the editors->doing_file setting
|
1246
|
+
in /Users/ttscoff/.config/doing/config.yml (TaskPaper).
|
1235
1247
|
===== Options
|
1236
1248
|
===== -a|--app APP_NAME
|
1237
1249
|
|
@@ -1316,17 +1328,19 @@ Show intervals with totals at the end of output
|
|
1316
1328
|
|
1317
1329
|
|
1318
1330
|
|
1319
|
-
==== Command: <tt>reset|begin
|
1331
|
+
==== Command: <tt>reset|begin DATE_STRING</tt>
|
1320
1332
|
Reset the start time of an entry
|
1321
1333
|
|
1322
|
-
|
1334
|
+
Update the start time of the last entry or the last entry matching a tag/search filter.
|
1335
|
+
If no argument is provided, the start time will be reset to the current time.
|
1336
|
+
If a date string is provided as an argument, the start time will be set to the parsed result.
|
1323
1337
|
===== Options
|
1324
1338
|
===== --bool BOOLEAN
|
1325
1339
|
|
1326
1340
|
Boolean (AND|OR|NOT) with which to combine multiple tag filters
|
1327
1341
|
|
1328
|
-
[Default Value]
|
1329
|
-
[Must Match] (?i-mx:^(?:and|all|any|or|not|none)$)
|
1342
|
+
[Default Value] PATTERN
|
1343
|
+
[Must Match] (?i-mx:^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$)
|
1330
1344
|
|
1331
1345
|
|
1332
1346
|
===== --case TYPE
|
@@ -1353,7 +1367,7 @@ Reset last entry matching search filter, surround with slashes for regex (e.g. "
|
|
1353
1367
|
|
1354
1368
|
===== --tag TAG
|
1355
1369
|
|
1356
|
-
Reset last entry matching tag
|
1370
|
+
Reset last entry matching tag. Wildcards allowed (*, ?).
|
1357
1371
|
|
1358
1372
|
[Default Value] None
|
1359
1373
|
|
@@ -1381,7 +1395,9 @@ Force exact search string matching (case sensitive)
|
|
1381
1395
|
==== Command: <tt>rotate </tt>
|
1382
1396
|
Move entries to archive file
|
1383
1397
|
|
1384
|
-
|
1398
|
+
As your doing file grows, commands can get slow. Given that your historical data (and your archive section)
|
1399
|
+
probably aren't providing any useful insights a year later, use this command to "rotate" old entries out to an archive
|
1400
|
+
file. You'll still have access to all historical data, but it won't be slowing down daily operation.
|
1385
1401
|
===== Options
|
1386
1402
|
===== --before DATE_STRING
|
1387
1403
|
|
@@ -1393,10 +1409,10 @@ Rotate entries older than date
|
|
1393
1409
|
|
1394
1410
|
===== --bool BOOLEAN
|
1395
1411
|
|
1396
|
-
Tag boolean (AND|OR|NOT)
|
1412
|
+
Tag boolean (AND|OR|NOT). Use PATTERN to parse + and - as booleans.
|
1397
1413
|
|
1398
|
-
[Default Value]
|
1399
|
-
[Must Match] (?i-mx:^(?:and|all|any|or|not|none)$)
|
1414
|
+
[Default Value] PATTERN
|
1415
|
+
[Must Match] (?i-mx:^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$)
|
1400
1416
|
|
1401
1417
|
|
1402
1418
|
===== --case TYPE
|
@@ -1431,7 +1447,7 @@ Search filter
|
|
1431
1447
|
|
1432
1448
|
===== --tag TAG
|
1433
1449
|
|
1434
|
-
Tag filter, combine multiple tags with a comma. Added for compatibility with other commands.
|
1450
|
+
Tag filter, combine multiple tags with a comma. Wildcards allowed (*, ?). Added for compatibility with other commands.
|
1435
1451
|
|
1436
1452
|
[Default Value] None
|
1437
1453
|
|
@@ -1464,6 +1480,14 @@ List all entries and select with typeahead fuzzy matching.
|
|
1464
1480
|
Multiple selections are allowed, hit tab to add the highlighted entry to the
|
1465
1481
|
selection, and use ctrl-a to select all visible items. Return processes the
|
1466
1482
|
selected entries.
|
1483
|
+
|
1484
|
+
Search in the menu by typing:
|
1485
|
+
|
1486
|
+
sbtrkt fuzzy-match Items that match sbtrkt
|
1487
|
+
|
1488
|
+
'wild exact-match (quoted) Items that include wild
|
1489
|
+
|
1490
|
+
!fire inverse-exact-match Items that do not include fire
|
1467
1491
|
===== Options
|
1468
1492
|
===== --after DATE_STRING
|
1469
1493
|
|
@@ -1605,7 +1629,11 @@ Force exact search string matching (case sensitive)
|
|
1605
1629
|
List all entries
|
1606
1630
|
|
1607
1631
|
The argument can be a section name, @tag(s) or both.
|
1608
|
-
"pick" or "choose" as an argument will offer a section menu.
|
1632
|
+
"pick" or "choose" as an argument will offer a section menu. Run with `--menu` to get a menu of available tags.
|
1633
|
+
|
1634
|
+
Show tags by passing @tagname arguments. Multiple tags can be combined, and you can specify the boolean used to
|
1635
|
+
combine them with `--bool (AND|OR|NOT)`. You can also use @+tagname to require a tag to match, or @-tagname to ignore
|
1636
|
+
entries containing tagname. +/- operators require `--bool PATTERN` (which is the default).
|
1609
1637
|
===== Options
|
1610
1638
|
===== -a|--age AGE
|
1611
1639
|
|
@@ -1623,10 +1651,10 @@ Show entries newer than date. If this is only a time (8am, 1:30pm, 15:00), all d
|
|
1623
1651
|
|
1624
1652
|
===== -b|--bool BOOLEAN
|
1625
1653
|
|
1626
|
-
Tag boolean (AND,OR,NOT)
|
1654
|
+
Tag boolean (AND,OR,NOT). Use PATTERN to parse + and - as booleans.
|
1627
1655
|
|
1628
|
-
[Default Value]
|
1629
|
-
[Must Match] (?i-mx:^(?:and|all|any|or|not|none)$)
|
1656
|
+
[Default Value] PATTERN
|
1657
|
+
[Must Match] (?i-mx:^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$)
|
1630
1658
|
|
1631
1659
|
|
1632
1660
|
===== --before DATE_STRING
|
@@ -1687,7 +1715,7 @@ Search filter, surround with slashes for regex (/query/), start with single quot
|
|
1687
1715
|
|
1688
1716
|
===== --tag TAG
|
1689
1717
|
|
1690
|
-
Tag filter, combine multiple tags with a comma. Added for compatibility with other commands.
|
1718
|
+
Tag filter, combine multiple tags with a comma. Use `--tag pick` for a menu of available tags. Wildcards allowed (*, ?). Added for compatibility with other commands.
|
1691
1719
|
|
1692
1720
|
[Default Value] None
|
1693
1721
|
|
@@ -1718,6 +1746,11 @@ Select from a menu of matching entries to perform additional operations
|
|
1718
1746
|
|
1719
1747
|
|
1720
1748
|
|
1749
|
+
===== -m|--menu
|
1750
|
+
Select section or tag to display from a menu
|
1751
|
+
|
1752
|
+
|
1753
|
+
|
1721
1754
|
===== --not
|
1722
1755
|
Show items that *don't* match search/tag/date filters
|
1723
1756
|
|
@@ -1805,10 +1838,10 @@ Add (or remove) tags from the last entry, or from multiple entries
|
|
1805
1838
|
===== Options
|
1806
1839
|
===== --bool BOOLEAN
|
1807
1840
|
|
1808
|
-
Boolean (AND|OR|NOT) with which to combine multiple tag filters
|
1841
|
+
Boolean (AND|OR|NOT) with which to combine multiple tag filters. Use PATTERN to parse + and - as booleans.
|
1809
1842
|
|
1810
|
-
[Default Value]
|
1811
|
-
[Must Match] (?i-mx:^(?:and|all|any|or|not|none)$)
|
1843
|
+
[Default Value] PATTERN
|
1844
|
+
[Must Match] (?i-mx:^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$)
|
1812
1845
|
|
1813
1846
|
|
1814
1847
|
===== -c|--count COUNT
|
@@ -1851,7 +1884,7 @@ Tag entries matching search filter, surround with slashes for regex (e.g. "/quer
|
|
1851
1884
|
===== --tag TAG
|
1852
1885
|
|
1853
1886
|
Tag the last X entries containing TAG.
|
1854
|
-
Separate multiple tags with comma (--tag=tag1,tag2), combine with --bool
|
1887
|
+
Separate multiple tags with comma (--tag=tag1,tag2), combine with --bool. Wildcards allowed (*, ?).
|
1855
1888
|
|
1856
1889
|
[Default Value] None
|
1857
1890
|
|
@@ -1901,6 +1934,39 @@ Force exact search string matching (case sensitive)
|
|
1901
1934
|
|
1902
1935
|
|
1903
1936
|
|
1937
|
+
==== Command: <tt>tags </tt>
|
1938
|
+
List all tags in the current Doing file
|
1939
|
+
|
1940
|
+
|
1941
|
+
===== Options
|
1942
|
+
===== -o|--order ORDER
|
1943
|
+
|
1944
|
+
Sort order (asc/desc)
|
1945
|
+
|
1946
|
+
[Default Value] asc
|
1947
|
+
[Must Match] (?i-mx:^(?:a(?:sc)?|d(?:esc)?)$)
|
1948
|
+
|
1949
|
+
|
1950
|
+
===== -s|--section SECTION_NAME
|
1951
|
+
|
1952
|
+
Section
|
1953
|
+
|
1954
|
+
[Default Value] All
|
1955
|
+
|
1956
|
+
|
1957
|
+
===== --sort SORT_ORDER
|
1958
|
+
|
1959
|
+
Sort by name or count
|
1960
|
+
|
1961
|
+
[Default Value] name
|
1962
|
+
[Must Match] (?-mix:^(?:n(?:ame)?|c(?:ount)?)$)
|
1963
|
+
|
1964
|
+
|
1965
|
+
===== -c|--[no-]counts
|
1966
|
+
Show count of occurrences
|
1967
|
+
|
1968
|
+
|
1969
|
+
|
1904
1970
|
==== Command: <tt>template TYPE</tt>
|
1905
1971
|
Output HTML, CSS, and Markdown (ERB) templates for customization
|
1906
1972
|
|
@@ -1924,7 +1990,8 @@ This command is coming from /Users/ttscoff/.config/doing/commands/test.rb
|
|
1924
1990
|
==== Command: <tt>today </tt>
|
1925
1991
|
List entries from today
|
1926
1992
|
|
1927
|
-
|
1993
|
+
List entries from the current day. Use --before, --after, and
|
1994
|
+
--from to specify time ranges.
|
1928
1995
|
===== Options
|
1929
1996
|
===== --after TIME_STRING
|
1930
1997
|
|
@@ -1984,10 +2051,13 @@ Show time totals at the end of output
|
|
1984
2051
|
|
1985
2052
|
|
1986
2053
|
|
1987
|
-
==== Command: <tt>undo
|
1988
|
-
Undo the last
|
2054
|
+
==== Command: <tt>undo COUNT</tt>
|
2055
|
+
Undo the last X changes to the Doing file
|
1989
2056
|
|
2057
|
+
Reverts the last X commands that altered the doing file.
|
2058
|
+
All changes performed by a single command are undone at once.
|
1990
2059
|
|
2060
|
+
Specify a number to jump back multiple revisions, or use --select for an interactive menu.
|
1991
2061
|
===== Options
|
1992
2062
|
===== -f|--file PATH
|
1993
2063
|
|
@@ -1996,10 +2066,28 @@ Specify alternate doing file
|
|
1996
2066
|
[Default Value] None
|
1997
2067
|
|
1998
2068
|
|
2069
|
+
===== -p|--prune COUNT
|
2070
|
+
|
2071
|
+
Remove old backups, retaining X files
|
2072
|
+
|
2073
|
+
[Default Value] None
|
2074
|
+
|
2075
|
+
|
2076
|
+
===== -i|--interactive
|
2077
|
+
Select from recent backups
|
2078
|
+
|
2079
|
+
|
2080
|
+
|
2081
|
+
===== -r|--[no-]redo
|
2082
|
+
Redo last undo. Note: you cannot undo a redo.
|
2083
|
+
|
2084
|
+
|
2085
|
+
|
1999
2086
|
==== Command: <tt>view VIEW_NAME</tt>
|
2000
2087
|
Display a user-created view
|
2001
2088
|
|
2002
|
-
|
2089
|
+
Views are defined in your configuration (use `doing config` to edit).
|
2090
|
+
Command line options override view configuration.
|
2003
2091
|
===== Options
|
2004
2092
|
===== --after DATE_STRING
|
2005
2093
|
|
@@ -2010,10 +2098,10 @@ View entries newer than date. If this is only a time (8am, 1:30pm, 15:00), all d
|
|
2010
2098
|
|
2011
2099
|
===== -b|--bool BOOLEAN
|
2012
2100
|
|
2013
|
-
Tag boolean (AND,OR,NOT)
|
2101
|
+
Tag boolean (AND,OR,NOT). Use PATTERN to parse + and - as booleans.
|
2014
2102
|
|
2015
|
-
[Default Value]
|
2016
|
-
[Must Match] (?i-mx:^(?:and|all|any|or|not|none)$)
|
2103
|
+
[Default Value] PATTERN
|
2104
|
+
[Must Match] (?i-mx:^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$)
|
2017
2105
|
|
2018
2106
|
|
2019
2107
|
===== --before DATE_STRING
|
@@ -2074,7 +2162,7 @@ Search filter, surround with slashes for regex (/query/), start with single quot
|
|
2074
2162
|
|
2075
2163
|
===== --tag TAG
|
2076
2164
|
|
2077
|
-
Tag filter, combine multiple tags with a comma.
|
2165
|
+
Tag filter, combine multiple tags with a comma. Wildcards allowed (*, ?).
|
2078
2166
|
|
2079
2167
|
[Default Value] None
|
2080
2168
|
|
@@ -2162,7 +2250,7 @@ Include entries newer than date
|
|
2162
2250
|
Tag boolean (AND,OR,NOT)
|
2163
2251
|
|
2164
2252
|
[Default Value] OR
|
2165
|
-
[Must Match] (?i-mx:^(?:and|all|any|or|not|none)$)
|
2253
|
+
[Must Match] (?i-mx:^(?:and|all|any|or|not|none|p(?:at(?:tern)?)?)$)
|
2166
2254
|
|
2167
2255
|
|
2168
2256
|
===== --before DATE_STRING
|
@@ -2208,7 +2296,8 @@ Only show items with recorded time intervals
|
|
2208
2296
|
|
2209
2297
|
|
2210
2298
|
==== Command: <tt>yesterday </tt>
|
2211
|
-
|
2299
|
+
Show only entries with start times within the previous 24 hour period. Use --before, --after, and --from to limit to
|
2300
|
+
time spans within the day.
|
2212
2301
|
|
2213
2302
|
|
2214
2303
|
===== Options
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'parslet'
|
4
|
+
|
5
|
+
module BooleanTermParser
|
6
|
+
# This query parser adds an optional operator ("+" or "-") to the simple term
|
7
|
+
# parser. In order to do that, a new "clause" node is added to the parse tree.
|
8
|
+
class QueryParser < Parslet::Parser
|
9
|
+
rule(:term) { match('[^\s]').repeat(1).as(:term) }
|
10
|
+
rule(:operator) { (str('+') | str('-')).as(:operator) }
|
11
|
+
rule(:clause) { (operator.maybe >> term).as(:clause) }
|
12
|
+
rule(:space) { match('\s').repeat(1) }
|
13
|
+
rule(:query) { (clause >> space.maybe).repeat.as(:query) }
|
14
|
+
root(:query)
|
15
|
+
end
|
16
|
+
|
17
|
+
class QueryTransformer < Parslet::Transform
|
18
|
+
rule(:clause => subtree(:clause)) do
|
19
|
+
Clause.new(clause[:operator]&.to_s, clause[:term].to_s)
|
20
|
+
end
|
21
|
+
rule(:query => sequence(:clauses)) { Query.new(clauses) }
|
22
|
+
end
|
23
|
+
|
24
|
+
class Operator
|
25
|
+
def self.symbol(str)
|
26
|
+
case str
|
27
|
+
when '+'
|
28
|
+
:must
|
29
|
+
when '-'
|
30
|
+
:must_not
|
31
|
+
when nil
|
32
|
+
:should
|
33
|
+
else
|
34
|
+
raise "Unknown operator: #{str}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
class Clause
|
40
|
+
attr_accessor :operator, :term
|
41
|
+
|
42
|
+
def initialize(operator, term)
|
43
|
+
self.operator = Operator.symbol(operator)
|
44
|
+
self.term = term
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
class Query
|
49
|
+
attr_accessor :should_terms, :must_not_terms, :must_terms
|
50
|
+
|
51
|
+
def initialize(clauses)
|
52
|
+
grouped = clauses.chunk { |c| c.operator }.to_h
|
53
|
+
self.should_terms = grouped.fetch(:should, []).map(&:term)
|
54
|
+
self.must_not_terms = grouped.fetch(:must_not, []).map(&:term)
|
55
|
+
self.must_terms = grouped.fetch(:must, []).map(&:term)
|
56
|
+
end
|
57
|
+
|
58
|
+
def to_elasticsearch
|
59
|
+
query = {}
|
60
|
+
|
61
|
+
if should_terms.any?
|
62
|
+
query[:should] = should_terms.map do |term|
|
63
|
+
match(term)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
if must_terms.any?
|
68
|
+
query[:must] = must_terms.map do |term|
|
69
|
+
match(term)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
if must_not_terms.any?
|
74
|
+
query[:must_not] = must_not_terms.map do |term|
|
75
|
+
match(term)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
query
|
80
|
+
end
|
81
|
+
|
82
|
+
def match(term)
|
83
|
+
term
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
data/lib/doing/configuration.rb
CHANGED
@@ -7,7 +7,11 @@ module Doing
|
|
7
7
|
class Configuration
|
8
8
|
attr_reader :settings
|
9
9
|
|
10
|
-
attr_writer :ignore_local, :config_file
|
10
|
+
attr_writer :ignore_local, :config_file, :force_answer
|
11
|
+
|
12
|
+
def force_answer
|
13
|
+
@force_answer ||= false
|
14
|
+
end
|
11
15
|
|
12
16
|
MissingConfigFile = Class.new(RuntimeError)
|
13
17
|
|
@@ -26,10 +30,12 @@ module Doing
|
|
26
30
|
'command_path' => File.join(Util.user_home, '.config', 'doing', 'commands')
|
27
31
|
},
|
28
32
|
'doing_file' => '~/what_was_i_doing.md',
|
33
|
+
'backup_dir' => '~/.doing_backup',
|
29
34
|
'current_section' => 'Currently',
|
30
35
|
'paginate' => false,
|
31
36
|
'never_time' => [],
|
32
37
|
'never_finish' => [],
|
38
|
+
'date_tags' => ['done', 'defer(?:red)?', 'waiting'],
|
33
39
|
|
34
40
|
'timer_format' => 'text',
|
35
41
|
'interval_format' => 'text',
|
@@ -128,10 +134,13 @@ module Doing
|
|
128
134
|
## @return [String] file path
|
129
135
|
##
|
130
136
|
def choose_config
|
137
|
+
return @config_file if @force_answer
|
138
|
+
|
131
139
|
if @additional_configs.count.positive?
|
132
|
-
choices = [@config_file]
|
133
|
-
choices.
|
134
|
-
|
140
|
+
choices = [@config_file].concat(@additional_configs)
|
141
|
+
res = Doing::Prompt.choose_from(choices.uniq.sort.reverse,
|
142
|
+
sorted: false,
|
143
|
+
prompt: 'Local configs found, select which to update > ')
|
135
144
|
|
136
145
|
raise UserCancelled, 'Cancelled' unless res
|
137
146
|
|