doing 2.1.14 → 2.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.irbrc +1 -0
- data/.yardoc/checksums +14 -12
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/CHANGELOG.md +66 -0
- data/Gemfile.lock +3 -2
- data/README.md +56 -19
- data/bin/doing +134 -47
- data/docs/doc/Array.html +117 -3
- data/docs/doc/BooleanTermParser/Clause.html +1 -1
- data/docs/doc/BooleanTermParser/Operator.html +1 -1
- data/docs/doc/BooleanTermParser/Query.html +1 -1
- data/docs/doc/BooleanTermParser/QueryParser.html +1 -1
- data/docs/doc/BooleanTermParser/QueryTransformer.html +1 -1
- data/docs/doc/BooleanTermParser.html +1 -1
- data/docs/doc/Doing/Color.html +6 -2
- data/docs/doc/Doing/Completion.html +1 -1
- data/docs/doc/Doing/Configuration.html +8 -4
- data/docs/doc/Doing/Errors/DoingNoTraceError.html +1 -1
- data/docs/doc/Doing/Errors/DoingRuntimeError.html +1 -1
- data/docs/doc/Doing/Errors/DoingStandardError.html +1 -1
- data/docs/doc/Doing/Errors/EmptyInput.html +1 -1
- data/docs/doc/Doing/Errors/NoResults.html +1 -1
- data/docs/doc/Doing/Errors/PluginException.html +1 -1
- data/docs/doc/Doing/Errors/UserCancelled.html +1 -1
- data/docs/doc/Doing/Errors/WrongCommand.html +1 -1
- data/docs/doc/Doing/Errors.html +1 -1
- data/docs/doc/Doing/Hooks.html +1 -1
- data/docs/doc/Doing/Item.html +224 -2
- data/docs/doc/Doing/Items.html +2 -2
- data/docs/doc/Doing/LogAdapter.html +1 -1
- data/docs/doc/Doing/Note.html +2 -2
- data/docs/doc/Doing/Pager.html +1 -1
- data/docs/doc/Doing/Plugins.html +1 -1
- data/docs/doc/Doing/Prompt.html +69 -1
- data/docs/doc/Doing/Section.html +1 -1
- data/docs/doc/Doing/TemplateString.html +2 -2
- data/docs/doc/Doing/Util/Backup.html +1 -1
- data/docs/doc/Doing/Util.html +1 -1
- data/docs/doc/Doing/WWID.html +71 -67
- data/docs/doc/Doing.html +3 -3
- data/docs/doc/GLI/Commands/MarkdownDocumentListener.html +1 -1
- data/docs/doc/GLI/Commands.html +1 -1
- data/docs/doc/GLI.html +1 -1
- data/docs/doc/Hash.html +1 -1
- data/docs/doc/Numeric.html +279 -0
- data/docs/doc/PhraseParser/Operator.html +1 -1
- data/docs/doc/PhraseParser/PhraseClause.html +1 -1
- data/docs/doc/PhraseParser/Query.html +1 -1
- data/docs/doc/PhraseParser/QueryParser.html +1 -1
- data/docs/doc/PhraseParser/QueryTransformer.html +1 -1
- data/docs/doc/PhraseParser/TermClause.html +1 -1
- data/docs/doc/PhraseParser.html +1 -1
- data/docs/doc/Status.html +1 -1
- data/docs/doc/String.html +997 -118
- data/docs/doc/Symbol.html +1 -1
- data/docs/doc/Time.html +1 -1
- data/docs/doc/_index.html +14 -9
- data/docs/doc/class_list.html +1 -1
- data/docs/doc/file.README.html +41 -15
- data/docs/doc/index.html +41 -15
- data/docs/doc/method_list.html +448 -312
- data/docs/doc/top-level-namespace.html +2 -2
- data/docs/index.md +56 -19
- data/doing.gemspec +1 -0
- data/doing.rdoc +36 -6
- data/example_plugin.rb +2 -4
- data/lib/completion/_doing.zsh +8 -8
- data/lib/completion/doing.bash +12 -12
- data/lib/completion/doing.fish +8 -3
- data/lib/doing/array_chronify.rb +57 -0
- data/lib/doing/colors.rb +4 -0
- data/lib/doing/configuration.rb +6 -2
- data/lib/doing/item.rb +83 -0
- data/lib/doing/log_adapter.rb +3 -3
- data/lib/doing/numeric_chronify.rb +40 -0
- data/lib/doing/plugins/export/dayone_export.rb +1 -1
- data/lib/doing/plugins/export/json_export.rb +2 -2
- data/lib/doing/plugins/export/template_export.rb +49 -90
- data/lib/doing/prompt.rb +52 -0
- data/lib/doing/string.rb +137 -33
- data/lib/doing/string_chronify.rb +112 -14
- data/lib/doing/template_string.rb +1 -1
- data/lib/doing/time.rb +4 -4
- data/lib/doing/util_backup.rb +1 -1
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +107 -101
- data/lib/doing.rb +35 -31
- data/lib/examples/plugins/say_export.rb +1 -4
- metadata +26 -2
data/bin/doing
CHANGED
@@ -199,7 +199,7 @@ command %i[again resume] do |c|
|
|
199
199
|
end
|
200
200
|
|
201
201
|
note = Doing::Note.new(options[:note])
|
202
|
-
note.add(Doing::Prompt.
|
202
|
+
note.add(Doing::Prompt.read_lines(prompt: 'Add a note')) if options[:ask]
|
203
203
|
|
204
204
|
options[:note] = note
|
205
205
|
|
@@ -338,19 +338,26 @@ command %i[done did] do |c|
|
|
338
338
|
c.switch %i[a archive], negatable: false, default_value: false
|
339
339
|
|
340
340
|
c.desc %(Set finish date to specific date/time (natural langauge parsed, e.g. --at=1:30pm).
|
341
|
-
|
341
|
+
Used with --took, backdates start date)
|
342
342
|
c.arg_name 'DATE_STRING'
|
343
|
-
c.flag [
|
343
|
+
c.flag %i[at finished]
|
344
344
|
|
345
345
|
c.desc 'Backdate start date by interval or set to time [4pm|20m|2h|"yesterday noon"]'
|
346
346
|
c.arg_name 'DATE_STRING'
|
347
347
|
c.flag %i[b back started]
|
348
348
|
|
349
|
+
c.desc %(
|
350
|
+
Start and end times as a date/time range `doing done --from "1am to 8am"`.
|
351
|
+
Overrides other date flags.
|
352
|
+
)
|
353
|
+
c.arg_name 'TIME_RANGE'
|
354
|
+
c.flag [:from]
|
355
|
+
|
349
356
|
c.desc %(Set completion date to start date plus interval (XX[mhd] or HH:MM).
|
350
357
|
If used without the --back option, the start date will be moved back to allow
|
351
358
|
the completion date to be the current time.)
|
352
359
|
c.arg_name 'INTERVAL'
|
353
|
-
c.flag %i[t took]
|
360
|
+
c.flag %i[t took for]
|
354
361
|
|
355
362
|
c.desc 'Section'
|
356
363
|
c.arg_name 'NAME'
|
@@ -377,30 +384,41 @@ command %i[done did] do |c|
|
|
377
384
|
took = 0
|
378
385
|
donedate = nil
|
379
386
|
|
380
|
-
if options[:
|
381
|
-
|
382
|
-
|
383
|
-
end
|
384
|
-
|
385
|
-
if options[:back]
|
386
|
-
date = options[:back].chronify(guess: :begin)
|
387
|
-
raise InvalidTimeExpression, 'Unable to parse date string for --back' if date.nil?
|
387
|
+
if options[:from]
|
388
|
+
date, finish_date = options[:from].split_date_range
|
389
|
+
finish_date ||= Time.now
|
388
390
|
else
|
389
|
-
|
390
|
-
|
391
|
+
if options[:took]
|
392
|
+
took = options[:took].chronify_qty
|
393
|
+
raise InvalidTimeExpression, 'Unable to parse date string for --took' if took.nil?
|
394
|
+
end
|
391
395
|
|
392
|
-
|
393
|
-
|
394
|
-
|
396
|
+
if options[:back]
|
397
|
+
date = options[:back].chronify(guess: :begin)
|
398
|
+
raise InvalidTimeExpression, 'Unable to parse date string for --back' if date.nil?
|
399
|
+
else
|
400
|
+
date = options[:took] ? Time.now - took : Time.now
|
401
|
+
end
|
395
402
|
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
403
|
+
if options[:at]
|
404
|
+
finish_date = options[:at].chronify(guess: :begin)
|
405
|
+
raise InvalidTimeExpression, 'Unable to parse date string for --at' if finish_date.nil?
|
406
|
+
|
407
|
+
if options[:took]
|
408
|
+
date = finish_date - took
|
409
|
+
else
|
410
|
+
date ||= finish_date
|
411
|
+
end
|
412
|
+
elsif options[:took]
|
413
|
+
finish_date = date + took
|
414
|
+
else
|
415
|
+
finish_date = Time.now
|
416
|
+
end
|
401
417
|
end
|
402
418
|
|
403
419
|
if options[:date]
|
420
|
+
finish_date = wwid.verify_duration(date, finish_date) unless options[:took] || options[:from]
|
421
|
+
|
404
422
|
donedate = finish_date.strftime('%F %R')
|
405
423
|
end
|
406
424
|
|
@@ -410,9 +428,13 @@ command %i[done did] do |c|
|
|
410
428
|
section = settings['current_section']
|
411
429
|
end
|
412
430
|
|
431
|
+
|
413
432
|
note = Doing::Note.new
|
414
433
|
note.add(options[:note]) if options[:note]
|
415
|
-
|
434
|
+
|
435
|
+
if options[:ask] && !options[:editor]
|
436
|
+
note.add(Doing::Prompt.read_lines(prompt: 'Add a note'))
|
437
|
+
end
|
416
438
|
|
417
439
|
if options[:editor]
|
418
440
|
raise MissingEditor, 'No EDITOR variable defined in environment' if Doing::Util.default_editor.nil?
|
@@ -438,6 +460,12 @@ command %i[done did] do |c|
|
|
438
460
|
raise EmptyInput, 'No content' unless input && !input.empty?
|
439
461
|
|
440
462
|
d, title, note = wwid.format_input(input)
|
463
|
+
|
464
|
+
if options[:ask]
|
465
|
+
ask_note = Doing::Prompt.read_lines(prompt: 'Add a note')
|
466
|
+
note.add(ask_note) unless ask_note.empty?
|
467
|
+
end
|
468
|
+
|
441
469
|
date = d.nil? ? date : d
|
442
470
|
new_entry = Doing::Item.new(date, title, section, note)
|
443
471
|
if new_entry.should_finish?
|
@@ -467,7 +495,6 @@ command %i[done did] do |c|
|
|
467
495
|
if options[:remove]
|
468
496
|
wwid.tag_last({ tags: ['done'], count: 1, section: section, remove: true })
|
469
497
|
else
|
470
|
-
note = options[:note] ? Doing::Note.new(options[:note]) : nil
|
471
498
|
opt = {
|
472
499
|
archive: options[:archive],
|
473
500
|
back: finish_date,
|
@@ -482,12 +509,13 @@ command %i[done did] do |c|
|
|
482
509
|
wwid.tag_last(opt)
|
483
510
|
end
|
484
511
|
elsif !args.empty?
|
485
|
-
note = Doing::Note.new(options[:note])
|
486
512
|
d, title, new_note = wwid.format_input([args.join(' '), note.strip_lines.join("\n")].join("\n"))
|
487
513
|
date = d.nil? ? date : d
|
514
|
+
new_note.add(options[:note])
|
488
515
|
title.chomp!
|
489
516
|
section = 'Archive' if options[:archive]
|
490
517
|
new_entry = Doing::Item.new(date, title, section, new_note)
|
518
|
+
|
491
519
|
if new_entry.should_finish?
|
492
520
|
if new_entry.should_time?
|
493
521
|
new_entry.tag('done', value: donedate)
|
@@ -495,12 +523,14 @@ command %i[done did] do |c|
|
|
495
523
|
new_entry.tag('done')
|
496
524
|
end
|
497
525
|
end
|
526
|
+
|
498
527
|
Doing::Hooks.trigger :pre_entry_add, wwid, new_entry
|
499
528
|
wwid.content.push(new_entry)
|
500
529
|
Doing::Hooks.trigger :post_entry_added, wwid, new_entry.dup
|
501
530
|
wwid.write(wwid.doing_file)
|
502
531
|
Doing.logger.info('Entry Added:', new_entry.title)
|
503
532
|
elsif $stdin.stat.size.positive?
|
533
|
+
note = Doing::Note.new(options[:note])
|
504
534
|
d, title, note = wwid.format_input($stdin.read.strip)
|
505
535
|
unless d.nil?
|
506
536
|
Doing.logger.debug('Parser:', 'Date detected in input, overriding command line values')
|
@@ -548,7 +578,7 @@ command :finish do |c|
|
|
548
578
|
|
549
579
|
c.desc 'Set the completed date to the start date plus XX[hmd]'
|
550
580
|
c.arg_name 'INTERVAL'
|
551
|
-
c.flag %i[t took]
|
581
|
+
c.flag %i[t took for]
|
552
582
|
|
553
583
|
c.desc %(Set finish date to specific date/time (natural langauge parsed, e.g. --at=1:30pm). If used, ignores --back.)
|
554
584
|
c.arg_name 'DATE_STRING'
|
@@ -710,22 +740,29 @@ command :later do |c|
|
|
710
740
|
date = Time.now
|
711
741
|
end
|
712
742
|
|
713
|
-
ask_note = options[:ask] ? Doing::Prompt.
|
743
|
+
ask_note = options[:ask] && !options[:editor] && args.count.positive? ? Doing::Prompt.read_lines(prompt: 'Add a note') : ''
|
714
744
|
|
715
|
-
if options[:editor]
|
745
|
+
if options[:editor]
|
716
746
|
raise MissingEditor, 'No EDITOR variable defined in environment' if Doing::Util.default_editor.nil?
|
717
747
|
|
748
|
+
input = ''
|
718
749
|
input += date.strftime('%F %R | ')
|
719
750
|
input += args.empty? ? '' : args.join(' ')
|
720
751
|
input += "\n#{options[:note]}" if options[:note]
|
721
752
|
input += "\n#{ask_note}" unless ask_note.empty?
|
722
753
|
|
723
754
|
input = wwid.fork_editor(input).strip
|
724
|
-
raise EmptyInput, 'No content' unless input && !input.empty?
|
725
755
|
|
726
756
|
d, title, note = wwid.format_input(input)
|
727
|
-
|
757
|
+
raise EmptyInput, 'No content' if title.empty?
|
758
|
+
|
728
759
|
note.add(options[:note]) if options[:note]
|
760
|
+
if ask_note.empty? && options[:ask]
|
761
|
+
ask_note = Doing::Prompt.read_lines(prompt: 'Add a note')
|
762
|
+
note.add(ask_note) unless ask_note.empty?
|
763
|
+
end
|
764
|
+
|
765
|
+
date = d.nil? ? date : d
|
729
766
|
wwid.add_item(title.cap_first, 'Later', { note: note, back: date })
|
730
767
|
wwid.write(wwid.doing_file)
|
731
768
|
elsif !args.empty?
|
@@ -746,7 +783,16 @@ command :later do |c|
|
|
746
783
|
wwid.add_item(title.cap_first, 'Later', { note: note, back: date })
|
747
784
|
wwid.write(wwid.doing_file)
|
748
785
|
else
|
749
|
-
|
786
|
+
title = Doing::Prompt.read_line(prompt: 'Entry content')
|
787
|
+
raise EmptyInput, 'You must provide content when creating a new entry' if title.strip.empty?
|
788
|
+
|
789
|
+
note = Doing::Note.new
|
790
|
+
res = Doing::Prompt.yn('Add a note', default_response: false)
|
791
|
+
ask_note = res ? Doing::Prompt.read_lines(prompt: 'Enter note') : []
|
792
|
+
note.add(ask_note)
|
793
|
+
|
794
|
+
wwid.add_item(title.cap_first, 'Later', { note: note, back: date })
|
795
|
+
wwid.write(wwid.doing_file)
|
750
796
|
end
|
751
797
|
end
|
752
798
|
end
|
@@ -928,7 +974,7 @@ command :meanwhile do |c|
|
|
928
974
|
end
|
929
975
|
input = ''
|
930
976
|
|
931
|
-
ask_note = options[:ask] ? Doing::Prompt.
|
977
|
+
ask_note = options[:ask] ? Doing::Prompt.read_lines(prompt: 'Add a note') : []
|
932
978
|
|
933
979
|
if options[:editor]
|
934
980
|
raise MissingEditor, 'No EDITOR variable defined in environment' if Doing::Util.default_editor.nil?
|
@@ -1052,7 +1098,7 @@ command :note do |c|
|
|
1052
1098
|
|
1053
1099
|
last_note = last_entry.note || Doing::Note.new
|
1054
1100
|
new_note = Doing::Note.new
|
1055
|
-
ask_note = options[:ask] ? Doing::Prompt.
|
1101
|
+
ask_note = options[:ask] ? Doing::Prompt.read_lines(prompt: 'Add a note') : ''
|
1056
1102
|
|
1057
1103
|
if options[:editor] || (args.empty? && $stdin.stat.size.zero? && !options[:remove] && !options[:ask])
|
1058
1104
|
raise MissingEditor, 'No EDITOR variable defined in environment' if Doing::Util.default_editor.nil?
|
@@ -1102,10 +1148,13 @@ long_desc %(Record what you're starting now, or backdate the start time using na
|
|
1102
1148
|
|
1103
1149
|
A parenthetical at the end of the entry will be converted to a note.
|
1104
1150
|
|
1105
|
-
Run
|
1151
|
+
Run without arguments to create a new entry interactively.
|
1152
|
+
|
1153
|
+
Run with --editor to create a new entry using #{Doing::Util.default_editor}.)
|
1106
1154
|
arg_name 'ENTRY'
|
1107
1155
|
command %i[now next] do |c|
|
1108
|
-
c.example 'doing now', desc:
|
1156
|
+
c.example 'doing now', desc: 'Create a new entry with interactive prompts'
|
1157
|
+
c.example 'doing now -e', desc: "Open #{Doing::Util.default_editor} to input an entry and optional note"
|
1109
1158
|
c.example 'doing now working on a new project', desc: 'Add a new entry at the current time'
|
1110
1159
|
c.example 'doing now debugging @project2', desc: 'Add an entry with a tag'
|
1111
1160
|
c.example 'doing now adding an entry (with a note)', desc: 'Parenthetical at end is converted to note'
|
@@ -1151,9 +1200,9 @@ command %i[now next] do |c|
|
|
1151
1200
|
options[:section] = settings['current_section']
|
1152
1201
|
end
|
1153
1202
|
|
1154
|
-
ask_note = options[:ask] ? Doing::Prompt.
|
1203
|
+
ask_note = options[:ask] && !options[:editor] && args.count.positive? ? Doing::Prompt.read_lines(prompt: 'Add a note') : ''
|
1155
1204
|
|
1156
|
-
if options[:editor]
|
1205
|
+
if options[:editor]
|
1157
1206
|
raise MissingEditor, 'No EDITOR variable defined in environment' if Doing::Util.default_editor.nil?
|
1158
1207
|
|
1159
1208
|
input = date.strftime('%F %R | ')
|
@@ -1162,9 +1211,13 @@ command %i[now next] do |c|
|
|
1162
1211
|
input += "\n#{ask_note}" unless ask_note.empty?
|
1163
1212
|
input = wwid.fork_editor(input).strip
|
1164
1213
|
|
1165
|
-
raise EmptyInput, 'No content' if input.empty?
|
1166
|
-
|
1167
1214
|
date, title, note = wwid.format_input(input)
|
1215
|
+
raise EmptyInput, 'No content' if title.strip.empty?
|
1216
|
+
|
1217
|
+
if ask_note.empty? && options[:ask]
|
1218
|
+
ask_note = Doing::Prompt.read_lines(prompt: 'Add a note')
|
1219
|
+
note.add(ask_note) unless ask_note.empty?
|
1220
|
+
end
|
1168
1221
|
|
1169
1222
|
wwid.add_item(title.cap_first, section, { note: note, back: date, timed: options[:finish_last] })
|
1170
1223
|
wwid.write(wwid.doing_file)
|
@@ -1183,11 +1236,26 @@ command %i[now next] do |c|
|
|
1183
1236
|
date = d
|
1184
1237
|
end
|
1185
1238
|
note.add(options[:note]) if options[:note]
|
1186
|
-
|
1239
|
+
if ask_note.empty? && options[:ask]
|
1240
|
+
ask_note = Doing::Prompt.read_lines(prompt: 'Add a note')
|
1241
|
+
note.add(ask_note) unless ask_note.empty?
|
1242
|
+
end
|
1187
1243
|
wwid.add_item(title.cap_first, section, { note: note, back: date, timed: options[:finish_last] })
|
1188
1244
|
wwid.write(wwid.doing_file)
|
1189
1245
|
else
|
1190
|
-
|
1246
|
+
tags = wwid.all_tags(wwid.content)
|
1247
|
+
$stderr.puts Doing::Color.boldgreen("Add a new entry. Tab will autocomplete known tags. Ctrl-c to cancel.")
|
1248
|
+
title = Doing::Prompt.read_line(prompt: 'Entry content', completions: tags)
|
1249
|
+
raise EmptyInput, 'You must provide content when creating a new entry' if title.strip.empty?
|
1250
|
+
|
1251
|
+
note = Doing::Note.new
|
1252
|
+
note.add(options[:note]) if options[:note]
|
1253
|
+
res = Doing::Prompt.yn('Add a note', default_response: false)
|
1254
|
+
ask_note = res ? Doing::Prompt.read_lines(prompt: 'Enter note') : []
|
1255
|
+
note.add(ask_note)
|
1256
|
+
|
1257
|
+
wwid.add_item(title.cap_first, section, { note: note, back: date, timed: options[:finish_last] })
|
1258
|
+
wwid.write(wwid.doing_file)
|
1191
1259
|
end
|
1192
1260
|
end
|
1193
1261
|
end
|
@@ -1510,7 +1578,7 @@ command :tag do |c|
|
|
1510
1578
|
|
1511
1579
|
c.action do |_global_options, options, args|
|
1512
1580
|
options[:fuzzy] = false
|
1513
|
-
raise MissingArgument, 'You must specify at least one tag' if args.empty? && !options[:autotag]
|
1581
|
+
# raise MissingArgument, 'You must specify at least one tag' if args.empty? && !options[:autotag]
|
1514
1582
|
|
1515
1583
|
raise InvalidArgument, '--search and --tag can not be used together' if options[:search] && options[:tag]
|
1516
1584
|
|
@@ -1530,11 +1598,15 @@ command :tag do |c|
|
|
1530
1598
|
if options[:autotag]
|
1531
1599
|
tags = []
|
1532
1600
|
else
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1601
|
+
if args.empty?
|
1602
|
+
tags = []
|
1603
|
+
else
|
1604
|
+
tags = if args.join('') =~ /,/
|
1605
|
+
args.join('').split(/ *, */)
|
1606
|
+
else
|
1607
|
+
args.join(' ').split(' ') # in case tags are quoted as one arg
|
1608
|
+
end
|
1609
|
+
end
|
1538
1610
|
|
1539
1611
|
tags.map! { |tag| tag.sub(/^@/, '').strip }
|
1540
1612
|
end
|
@@ -1678,6 +1750,9 @@ command %i[grep search] do |c|
|
|
1678
1750
|
c.arg_name 'TYPE'
|
1679
1751
|
c.flag [:case], must_match: /^[csi]/, default_value: settings.dig('search', 'case')
|
1680
1752
|
|
1753
|
+
c.desc "Highlight search matches in output. Only affects command line output"
|
1754
|
+
c.switch %i[h hilite], default_value: settings.dig('search', 'highlight')
|
1755
|
+
|
1681
1756
|
c.desc "Edit matching entries with #{Doing::Util.default_editor}"
|
1682
1757
|
c.switch %i[e editor], negatable: false, default_value: false
|
1683
1758
|
|
@@ -1755,6 +1830,9 @@ command :last do |c|
|
|
1755
1830
|
c.arg_name 'QUERY'
|
1756
1831
|
c.flag [:search]
|
1757
1832
|
|
1833
|
+
c.desc "Highlight search matches in output. Only affects command line output"
|
1834
|
+
c.switch %i[h hilite], default_value: settings.dig('search', 'highlight')
|
1835
|
+
|
1758
1836
|
c.desc 'Perform a tag value query ("@done > two hours ago" or "@progress < 50"). May be used multiple times, combined with --bool'
|
1759
1837
|
c.arg_name 'QUERY'
|
1760
1838
|
c.flag [:val], multiple: true, must_match: REGEX_VALUE_QUERY
|
@@ -1809,6 +1887,7 @@ command :last do |c|
|
|
1809
1887
|
search: options[:search],
|
1810
1888
|
fuzzy: options[:fuzzy],
|
1811
1889
|
case: options[:case],
|
1890
|
+
hilite: options[:hilite],
|
1812
1891
|
negate: options[:not],
|
1813
1892
|
tag: options[:tag],
|
1814
1893
|
tag_bool: options[:bool],
|
@@ -1954,6 +2033,9 @@ command :show do |c|
|
|
1954
2033
|
c.arg_name 'QUERY'
|
1955
2034
|
c.flag [:search]
|
1956
2035
|
|
2036
|
+
c.desc "Highlight search matches in output. Only affects command line output"
|
2037
|
+
c.switch %i[h hilite], default_value: settings.dig('search', 'highlight')
|
2038
|
+
|
1957
2039
|
# c.desc '[DEPRECATED] Use alternative fuzzy matching for search string'
|
1958
2040
|
# c.switch [:fuzzy], default_value: false, negatable: false
|
1959
2041
|
|
@@ -2101,6 +2183,7 @@ command :show do |c|
|
|
2101
2183
|
opt[:sort_tags] = options[:tag_sort] =~ /^n/i
|
2102
2184
|
opt[:count] = options[:count].to_i
|
2103
2185
|
opt[:highlight] = true
|
2186
|
+
opt[:hilite] = options[:hilite]
|
2104
2187
|
opt[:order] = options[:sort].normalize_order
|
2105
2188
|
opt[:tag] = nil
|
2106
2189
|
opt[:tag_order] = options[:tag_order].normalize_order
|
@@ -2427,6 +2510,9 @@ command :view do |c|
|
|
2427
2510
|
c.arg_name 'QUERY'
|
2428
2511
|
c.flag [:search]
|
2429
2512
|
|
2513
|
+
c.desc "Highlight search matches in output. Only affects command line output"
|
2514
|
+
c.switch %i[h hilite], default_value: settings.dig('search', 'highlight')
|
2515
|
+
|
2430
2516
|
# c.desc '[DEPRECATED] Use alternative fuzzy matching for search string'
|
2431
2517
|
# c.switch [:fuzzy], default_value: false, negatable: false
|
2432
2518
|
|
@@ -2587,6 +2673,7 @@ command :view do |c|
|
|
2587
2673
|
opts[:count] = count
|
2588
2674
|
opts[:format] = date_format
|
2589
2675
|
opts[:highlight] = options[:color]
|
2676
|
+
opts[:hilite] = options[:hilite]
|
2590
2677
|
opts[:only_timed] = only_timed
|
2591
2678
|
opts[:order] = order
|
2592
2679
|
opts[:output] = options[:interactive] ? nil : options[:output]
|
data/docs/doc/Array.html
CHANGED
@@ -94,14 +94,16 @@
|
|
94
94
|
|
95
95
|
<dl>
|
96
96
|
<dt>Defined in:</dt>
|
97
|
-
<dd>lib/doing/array.rb
|
97
|
+
<dd>lib/doing/array.rb<span class="defines">,<br />
|
98
|
+
lib/doing/array_chronify.rb</span>
|
99
|
+
</dd>
|
98
100
|
</dl>
|
99
101
|
|
100
102
|
</div>
|
101
103
|
|
102
104
|
<h2>Overview</h2><div class="docstring">
|
103
105
|
<div class="discussion">
|
104
|
-
<p>
|
106
|
+
<p>Chronify array helpers</p>
|
105
107
|
|
106
108
|
|
107
109
|
</div>
|
@@ -217,6 +219,29 @@
|
|
217
219
|
<span class="summary_desc"><div class='inline'><p>Convert an @tags to plain strings.</p>
|
218
220
|
</div></span>
|
219
221
|
|
222
|
+
</li>
|
223
|
+
|
224
|
+
|
225
|
+
<li class="public ">
|
226
|
+
<span class="summary_signature">
|
227
|
+
|
228
|
+
<a href="#time_string-instance_method" title="#time_string (instance method)">#<strong>time_string</strong>(format: :dhm) ⇒ String </a>
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
</span>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
<span class="summary_desc"><div class='inline'><p>Format [d, h, m] as string.</p>
|
243
|
+
</div></span>
|
244
|
+
|
220
245
|
</li>
|
221
246
|
|
222
247
|
|
@@ -464,6 +489,95 @@ with</p>
|
|
464
489
|
|
465
490
|
</ul>
|
466
491
|
|
492
|
+
</div>
|
493
|
+
</div>
|
494
|
+
|
495
|
+
<div class="method_details ">
|
496
|
+
<h3 class="signature " id="time_string-instance_method">
|
497
|
+
|
498
|
+
#<strong>time_string</strong>(format: :dhm) ⇒ <tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>
|
499
|
+
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
|
504
|
+
</h3><div class="docstring">
|
505
|
+
<div class="discussion">
|
506
|
+
<p>Format [d, h, m] as string</p>
|
507
|
+
|
508
|
+
|
509
|
+
</div>
|
510
|
+
</div>
|
511
|
+
<div class="tags">
|
512
|
+
<p class="tag_title">Parameters:</p>
|
513
|
+
<ul class="param">
|
514
|
+
|
515
|
+
<li>
|
516
|
+
|
517
|
+
<span class='name'>time</span>
|
518
|
+
|
519
|
+
|
520
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Array (class)">Array</a></span></tt>)</span>
|
521
|
+
|
522
|
+
|
523
|
+
|
524
|
+
—
|
525
|
+
<div class='inline'><p>Array of [days, hours,
|
526
|
+
minutes]</p>
|
527
|
+
</div>
|
528
|
+
|
529
|
+
</li>
|
530
|
+
|
531
|
+
<li>
|
532
|
+
|
533
|
+
<span class='name'>format</span>
|
534
|
+
|
535
|
+
|
536
|
+
<span class='type'>(<tt><span class='object_link'><a href="Symbol.html" title="Symbol (class)">Symbol</a></span></tt>)</span>
|
537
|
+
|
538
|
+
|
539
|
+
<em class="default">(defaults to: <tt>:dhm</tt>)</em>
|
540
|
+
|
541
|
+
|
542
|
+
—
|
543
|
+
<div class='inline'><p>The format, :dhm, :hm, :m, :clock, :natural</p>
|
544
|
+
</div>
|
545
|
+
|
546
|
+
</li>
|
547
|
+
|
548
|
+
</ul>
|
549
|
+
|
550
|
+
<p class="tag_title">Returns:</p>
|
551
|
+
<ul class="return">
|
552
|
+
|
553
|
+
<li>
|
554
|
+
|
555
|
+
|
556
|
+
<span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>)</span>
|
557
|
+
|
558
|
+
|
559
|
+
|
560
|
+
—
|
561
|
+
<div class='inline'><p>formatted string</p>
|
562
|
+
</div>
|
563
|
+
|
564
|
+
</li>
|
565
|
+
|
566
|
+
</ul>
|
567
|
+
<p class="tag_title">Raises:</p>
|
568
|
+
<ul class="raise">
|
569
|
+
|
570
|
+
<li>
|
571
|
+
|
572
|
+
|
573
|
+
<span class='type'>(<tt>InvalidArgument</tt>)</span>
|
574
|
+
|
575
|
+
|
576
|
+
|
577
|
+
</li>
|
578
|
+
|
579
|
+
</ul>
|
580
|
+
|
467
581
|
</div>
|
468
582
|
</div>
|
469
583
|
|
@@ -540,7 +654,7 @@ with</p>
|
|
540
654
|
</div>
|
541
655
|
|
542
656
|
<div id="footer">
|
543
|
-
Generated on
|
657
|
+
Generated on Tue Jan 18 07:44:44 2022 by
|
544
658
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
545
659
|
0.9.26 (ruby-3.0.1).
|
546
660
|
</div>
|
@@ -283,7 +283,7 @@
|
|
283
283
|
</div>
|
284
284
|
|
285
285
|
<div id="footer">
|
286
|
-
Generated on
|
286
|
+
Generated on Tue Jan 18 07:44:44 2022 by
|
287
287
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
288
288
|
0.9.26 (ruby-3.0.1).
|
289
289
|
</div>
|
@@ -162,7 +162,7 @@
|
|
162
162
|
</div>
|
163
163
|
|
164
164
|
<div id="footer">
|
165
|
-
Generated on
|
165
|
+
Generated on Tue Jan 18 07:44:44 2022 by
|
166
166
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
167
167
|
0.9.26 (ruby-3.0.1).
|
168
168
|
</div>
|
@@ -407,7 +407,7 @@
|
|
407
407
|
</div>
|
408
408
|
|
409
409
|
<div id="footer">
|
410
|
-
Generated on
|
410
|
+
Generated on Tue Jan 18 07:44:44 2022 by
|
411
411
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
412
412
|
0.9.26 (ruby-3.0.1).
|
413
413
|
</div>
|
@@ -125,7 +125,7 @@ parser. In order to do that, a new "clause" node is added to the parse
|
|
125
125
|
</div>
|
126
126
|
|
127
127
|
<div id="footer">
|
128
|
-
Generated on
|
128
|
+
Generated on Tue Jan 18 07:44:44 2022 by
|
129
129
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
130
130
|
0.9.26 (ruby-3.0.1).
|
131
131
|
</div>
|
@@ -114,7 +114,7 @@
|
|
114
114
|
</div>
|
115
115
|
|
116
116
|
<div id="footer">
|
117
|
-
Generated on
|
117
|
+
Generated on Tue Jan 18 07:44:44 2022 by
|
118
118
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
119
|
0.9.26 (ruby-3.0.1).
|
120
120
|
</div>
|
@@ -105,7 +105,7 @@
|
|
105
105
|
</div>
|
106
106
|
|
107
107
|
<div id="footer">
|
108
|
-
Generated on
|
108
|
+
Generated on Tue Jan 18 07:44:44 2022 by
|
109
109
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
110
110
|
0.9.26 (ruby-3.0.1).
|
111
111
|
</div>
|