doing 2.1.15 → 2.1.16
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 +5 -5
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/CHANGELOG.md +24 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/bin/doing +109 -44
- data/docs/doc/Array.html +1 -1
- 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 +1 -1
- data/docs/doc/Doing/Completion.html +1 -1
- data/docs/doc/Doing/Configuration.html +1 -1
- 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 +1 -1
- data/docs/doc/Doing/Items.html +1 -1
- data/docs/doc/Doing/LogAdapter.html +1 -1
- data/docs/doc/Doing/Note.html +1 -1
- 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 +37 -3
- data/docs/doc/Doing.html +2 -2
- 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 +1 -1
- 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 +92 -1
- data/docs/doc/Symbol.html +1 -1
- data/docs/doc/Time.html +1 -1
- data/docs/doc/_index.html +1 -1
- data/docs/doc/file.README.html +2 -2
- data/docs/doc/index.html +2 -2
- data/docs/doc/method_list.html +209 -185
- data/docs/doc/top-level-namespace.html +1 -1
- data/doing.rdoc +14 -4
- data/lib/completion/_doing.zsh +2 -2
- data/lib/completion/doing.bash +2 -2
- data/lib/completion/doing.fish +2 -1
- data/lib/doing/prompt.rb +41 -0
- data/lib/doing/string_chronify.rb +28 -0
- data/lib/doing/template_string.rb +1 -1
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +43 -13
- data/lib/doing.rb +5 -4
- metadata +2 -2
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
</div>
|
|
103
103
|
|
|
104
104
|
<div id="footer">
|
|
105
|
-
Generated on
|
|
105
|
+
Generated on Tue Jan 18 02:48:57 2022 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.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.16
|
|
9
9
|
|
|
10
10
|
=== Global Options
|
|
11
11
|
=== --config_file arg
|
|
@@ -528,10 +528,10 @@ Use this command to add an entry after you've already finished it. It will be im
|
|
|
528
528
|
You can modify the start and end times of the entry using the --back, --took, and --at flags, making it an easy
|
|
529
529
|
way to add entries in post and maintain accurate (albeit manual) time tracking.
|
|
530
530
|
===== Options
|
|
531
|
-
===== --at DATE_STRING
|
|
531
|
+
===== --at|--finished DATE_STRING
|
|
532
532
|
|
|
533
533
|
Set finish date to specific date/time (natural langauge parsed, e.g. --at=1:30pm).
|
|
534
|
-
|
|
534
|
+
Used with --took, backdates start date
|
|
535
535
|
|
|
536
536
|
[Default Value] None
|
|
537
537
|
|
|
@@ -543,6 +543,14 @@ Backdate start date by interval or set to time [4pm|20m|2h|"yesterday noon"]
|
|
|
543
543
|
[Default Value] None
|
|
544
544
|
|
|
545
545
|
|
|
546
|
+
===== --from TIME_RANGE
|
|
547
|
+
|
|
548
|
+
Start and end times as a date/time range `doing done --from "1am to 8am"`.
|
|
549
|
+
Overrides other date flags.
|
|
550
|
+
|
|
551
|
+
[Default Value] None
|
|
552
|
+
|
|
553
|
+
|
|
546
554
|
===== -n|--note TEXT
|
|
547
555
|
|
|
548
556
|
Include a note
|
|
@@ -1274,7 +1282,9 @@ Record what you're starting now, or backdate the start time using natural langua
|
|
|
1274
1282
|
|
|
1275
1283
|
A parenthetical at the end of the entry will be converted to a note.
|
|
1276
1284
|
|
|
1277
|
-
Run
|
|
1285
|
+
Run without arguments to create a new entry interactively.
|
|
1286
|
+
|
|
1287
|
+
Run with --editor to create a new entry using vim.
|
|
1278
1288
|
===== Options
|
|
1279
1289
|
===== -b|--back|--started DATE_STRING
|
|
1280
1290
|
|
data/lib/completion/_doing.zsh
CHANGED
|
@@ -106,10 +106,10 @@ function _doing() {
|
|
|
106
106
|
args=( {-d,--dump}"[DEPRECATED]" {-u,--update}"[DEPRECATED]" )
|
|
107
107
|
;;
|
|
108
108
|
done)
|
|
109
|
-
args=( {-a,--archive}"[Immediately archive the entry]" "(--ask)--ask}[Prompt for note via multi-line input]" "(--
|
|
109
|
+
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]" )
|
|
110
110
|
;;
|
|
111
111
|
did)
|
|
112
|
-
args=( {-a,--archive}"[Immediately archive the entry]" "(--ask)--ask}[Prompt for note via multi-line input]" "(--
|
|
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
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]" )
|
data/lib/completion/doing.bash
CHANGED
|
@@ -81,9 +81,9 @@ _doing_config() {
|
|
|
81
81
|
_doing_done() {
|
|
82
82
|
|
|
83
83
|
if [[ "$token" == --* ]]; then
|
|
84
|
-
COMPREPLY=( $( compgen -W '--archive --ask --
|
|
84
|
+
COMPREPLY=( $( compgen -W '--archive --ask --finished --started --date --editor --from --note --remove --section --for --unfinished' -- $token ) )
|
|
85
85
|
elif [[ "$token" == -* ]]; then
|
|
86
|
-
COMPREPLY=( $( compgen -W '-a -e -n -r -s -u --archive --ask --
|
|
86
|
+
COMPREPLY=( $( compgen -W '-a -e -n -r -s -u --archive --ask --finished --started --date --editor --from --note --remove --section --for --unfinished' -- $token ) )
|
|
87
87
|
|
|
88
88
|
fi
|
|
89
89
|
}
|
data/lib/completion/doing.fish
CHANGED
|
@@ -148,10 +148,11 @@ complete -c doing -l dump -s d -f -n '__fish_doing_using_command config' -d DEP
|
|
|
148
148
|
complete -c doing -l update -s u -f -n '__fish_doing_using_command config' -d DEPRECATED
|
|
149
149
|
complete -c doing -l archive -s a -f -n '__fish_doing_using_command done did' -d Immediately\ archive\ the\ entry
|
|
150
150
|
complete -c doing -l ask -f -n '__fish_doing_using_command done did' -d Prompt\ for\ note\ via\ multi-line\ input
|
|
151
|
-
complete -c doing -l
|
|
151
|
+
complete -c doing -l finished -f -r -n '__fish_doing_using_command done did' -d Set\ finish\ date\ to\ specific\ date/time
|
|
152
152
|
complete -c doing -l started -f -r -n '__fish_doing_using_command done did' -d Backdate\ start\ date\ by\ interval\ or\ set\ to\ time\ \[4pm\|20m\|2h\|\"yesterday\ noon\"\]
|
|
153
153
|
complete -c doing -l date -f -n '__fish_doing_using_command done did' -d Include\ date
|
|
154
154
|
complete -c doing -l editor -s e -f -n '__fish_doing_using_command done did' -d Edit\ entry\ with\ vim
|
|
155
|
+
complete -c doing -l from -f -r -n '__fish_doing_using_command done did' -d Start\ and\ end\ times\ as\ a\ date/time\ range\ \`doing\ done\ --from\ \"1am\ to\ 8am\"\`
|
|
155
156
|
complete -c doing -l note -s n -f -r -n '__fish_doing_using_command done did' -d Include\ a\ note
|
|
156
157
|
complete -c doing -l remove -s r -f -n '__fish_doing_using_command done did' -d Remove\ @done\ tag
|
|
157
158
|
complete -c doing -l section -s s -f -r -n '__fish_doing_using_command done did' -d Section
|
data/lib/doing/prompt.rb
CHANGED
|
@@ -23,6 +23,47 @@ module Doing
|
|
|
23
23
|
$stdin.gets.strip
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
+
def read_line(prompt: 'Enter text', completions: [], default_response: '')
|
|
27
|
+
return default_response if @default_answer
|
|
28
|
+
|
|
29
|
+
unless completions.empty?
|
|
30
|
+
completions.sort!
|
|
31
|
+
comp = proc { |s| completions.grep(/^#{Regexp.escape(s)}/) }
|
|
32
|
+
Readline.completion_append_character = " "
|
|
33
|
+
Readline.completion_proc = comp
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
begin
|
|
37
|
+
Readline.readline("#{yellow(prompt).sub(/:?$/, ':')} #{reset}", true).strip
|
|
38
|
+
rescue Interrupt
|
|
39
|
+
raise UserCancelled
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def read_lines(prompt: 'Enter text', completions: [])
|
|
44
|
+
return default_response if @default_answer
|
|
45
|
+
|
|
46
|
+
completions.sort!
|
|
47
|
+
comp = proc { |s| completions.grep(/^#{Regexp.escape(s)}/) }
|
|
48
|
+
Readline.completion_append_character = " "
|
|
49
|
+
Readline.completion_proc = comp
|
|
50
|
+
|
|
51
|
+
puts "#{boldgreen(prompt.sub(/:?$/, ':'))} #{yellow('Hit return for a new line, ')}#{boldwhite('enter a blank line (')}#{boldyellow('return twice')}#{boldwhite(') to end editing')}"
|
|
52
|
+
|
|
53
|
+
res = []
|
|
54
|
+
|
|
55
|
+
begin
|
|
56
|
+
while line = Readline.readline('> ', true)
|
|
57
|
+
break if line.strip.empty?
|
|
58
|
+
res << line.chomp
|
|
59
|
+
end
|
|
60
|
+
rescue Interrupt
|
|
61
|
+
raise UserCancelled
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
res.join("\n").strip
|
|
65
|
+
end
|
|
66
|
+
|
|
26
67
|
def request_lines(prompt: 'Enter text')
|
|
27
68
|
ask_note = []
|
|
28
69
|
reader = TTY::Reader.new(interrupt: -> { raise Errors::UserCancelled }, track_history: false)
|
|
@@ -151,5 +151,33 @@ module Doing
|
|
|
151
151
|
parsed_date.nil? ? m[0] : "@#{t}(#{parsed_date.strftime('%F %R')})"
|
|
152
152
|
end
|
|
153
153
|
end
|
|
154
|
+
|
|
155
|
+
##
|
|
156
|
+
## Splits a range string and returns an array of
|
|
157
|
+
## DateTime objects as [start, end]. If only one date is
|
|
158
|
+
## given, end time is nil.
|
|
159
|
+
##
|
|
160
|
+
## @return [Array<DateTime>] Start and end dates as
|
|
161
|
+
## array
|
|
162
|
+
## @example Process a natural language date range
|
|
163
|
+
## "mon 3pm to mon 5pm".split_date_range
|
|
164
|
+
##
|
|
165
|
+
def split_date_range
|
|
166
|
+
date_string = dup
|
|
167
|
+
case date_string
|
|
168
|
+
when / (to|through|thru|(un)?til|-+) /
|
|
169
|
+
dates = date_string.split(/ (?:to|through|thru|(?:un)?til|-+) /)
|
|
170
|
+
start = dates[0].chronify(guess: :begin)
|
|
171
|
+
finish = dates[-1].chronify(guess: :end)
|
|
172
|
+
else
|
|
173
|
+
start = date_string.chronify(guess: :begin)
|
|
174
|
+
finish = nil
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
raise InvalidTimeExpression, 'Unrecognized date string' unless start
|
|
178
|
+
|
|
179
|
+
Doing.logger.debug('Parser:', "date range interpreted as #{start.strftime('%F %R')} -- #{finish ? finish.strftime('%F %R') : 'now'}")
|
|
180
|
+
[start, finish]
|
|
181
|
+
end
|
|
154
182
|
end
|
|
155
183
|
end
|
|
@@ -176,7 +176,7 @@ module Doing
|
|
|
176
176
|
' '
|
|
177
177
|
else
|
|
178
178
|
line = l.gsub(/%/, '\%').strip.wrap(width, pad: pad, indent: indent, offset: 0, prefix: prefix, color: last_color, after: after, reset: reset, pad_first: true)
|
|
179
|
-
line.highlight_tags!(tags_color, last_color: last_color) unless tags_color.nil? || tags_color.empty?
|
|
179
|
+
line.highlight_tags!(tags_color, last_color: last_color) unless !tags_color || tags_color.nil? || tags_color.empty?
|
|
180
180
|
"#{line} "
|
|
181
181
|
end
|
|
182
182
|
end.join("\n")
|
data/lib/doing/version.rb
CHANGED
data/lib/doing/wwid.rb
CHANGED
|
@@ -187,6 +187,8 @@ module Doing
|
|
|
187
187
|
iso_rx = /\d{4}-\d\d-\d\d \d\d:\d\d/
|
|
188
188
|
date_rx = /^(?:\s*- )?(?<date>.*?) \| (?=\S)/
|
|
189
189
|
|
|
190
|
+
raise EmptyInput, 'No content' if title.sub(/^.*?\| */, '').strip.empty?
|
|
191
|
+
|
|
190
192
|
title.expand_date_tags(@config['date_tags'])
|
|
191
193
|
|
|
192
194
|
if title =~ date_rx
|
|
@@ -807,6 +809,7 @@ module Doing
|
|
|
807
809
|
end
|
|
808
810
|
|
|
809
811
|
def edit_items(items)
|
|
812
|
+
items.sort_by! { |i| i.date }
|
|
810
813
|
editable_items = []
|
|
811
814
|
|
|
812
815
|
items.each do |i|
|
|
@@ -815,16 +818,16 @@ module Doing
|
|
|
815
818
|
editable += "\n#{old_note}" unless old_note.nil?
|
|
816
819
|
editable_items << editable
|
|
817
820
|
end
|
|
818
|
-
divider = "
|
|
821
|
+
divider = "-----------"
|
|
819
822
|
notice =<<~EONOTICE
|
|
820
823
|
# - You may delete entries, but leave all divider lines (---) in place.
|
|
821
824
|
# - Start and @done dates replaced with a time string (yesterday 3pm) will
|
|
822
825
|
# be parsed automatically. Do not delete the pipe (|) between start date
|
|
823
826
|
# and entry title.
|
|
824
827
|
EONOTICE
|
|
825
|
-
input = "#{editable_items.map(&:strip).join(divider)}\n\n#{notice}"
|
|
828
|
+
input = "#{editable_items.map(&:strip).join("\n#{divider}\n")}\n\n#{notice}"
|
|
826
829
|
|
|
827
|
-
new_items = fork_editor(input).split(
|
|
830
|
+
new_items = fork_editor(input).split(/^#{divider}/).map(&:strip)
|
|
828
831
|
|
|
829
832
|
new_items.each_with_index do |new_item, i|
|
|
830
833
|
input_lines = new_item.split(/[\n\r]+/).delete_if(&:ignore?)
|
|
@@ -833,7 +836,7 @@ module Doing
|
|
|
833
836
|
if first_line.nil? || first_line =~ /^#{divider.strip}$/ || first_line.strip.empty?
|
|
834
837
|
deleted = @content.delete_item(items[i], single: new_items.count == 1)
|
|
835
838
|
Hooks.trigger :post_entry_removed, self, deleted
|
|
836
|
-
Doing.logger.
|
|
839
|
+
Doing.logger.info('Deleted:', deleted.title)
|
|
837
840
|
else
|
|
838
841
|
date, title, note = format_input(new_item)
|
|
839
842
|
|
|
@@ -961,8 +964,14 @@ module Doing
|
|
|
961
964
|
type = action =~ /^add/ ? 'add' : 'remove'
|
|
962
965
|
raise InvalidArgument, "'add tag' and 'remove tag' can not be used together" if opt[:tag]
|
|
963
966
|
|
|
964
|
-
|
|
965
|
-
|
|
967
|
+
tags = type == 'add' ? all_tags(@content) : all_tags(items)
|
|
968
|
+
|
|
969
|
+
puts "#{yellow}Separate multiple tags with spaces, hit tab to complete known tags#{type == 'add' ? ', include values with tag(value)' : ''}"
|
|
970
|
+
puts "#{boldgreen}Available tags: #{boldwhite}#{tags.sort.map(&:add_at).join(', ')}" if type == 'remove'
|
|
971
|
+
tag = Prompt.read_line(prompt: "Tags to #{type}", completions: tags)
|
|
972
|
+
|
|
973
|
+
# print "#{yellow("Tag to #{type}: ")}#{reset}"
|
|
974
|
+
# tag = $stdin.gets
|
|
966
975
|
next if tag =~ /^ *$/
|
|
967
976
|
|
|
968
977
|
opt[:tag] = tag.strip.sub(/^@/, '')
|
|
@@ -984,8 +993,9 @@ module Doing
|
|
|
984
993
|
opt[:output] = output_format.strip
|
|
985
994
|
res = opt[:force] ? false : Prompt.yn('Save to file?', default_response: 'n')
|
|
986
995
|
if res
|
|
987
|
-
print "#{yellow('File path/name: ')}#{reset}"
|
|
988
|
-
filename = $stdin.gets.strip
|
|
996
|
+
# print "#{yellow('File path/name: ')}#{reset}"
|
|
997
|
+
# filename = $stdin.gets.strip
|
|
998
|
+
filename = Prompt.read_line(prompt: 'File path/name')
|
|
989
999
|
next if filename.empty?
|
|
990
1000
|
|
|
991
1001
|
opt[:save_to] = filename
|
|
@@ -1093,10 +1103,10 @@ module Doing
|
|
|
1093
1103
|
i
|
|
1094
1104
|
end
|
|
1095
1105
|
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
options = { section: '
|
|
1106
|
+
export_items = Items.new
|
|
1107
|
+
export_items.concat(items)
|
|
1108
|
+
export_items.add_section(Section.new('Export'), log: false)
|
|
1109
|
+
options = { section: 'All' }
|
|
1100
1110
|
|
|
1101
1111
|
if opt[:output] =~ /doing/
|
|
1102
1112
|
options[:output] = 'template'
|
|
@@ -1106,7 +1116,7 @@ module Doing
|
|
|
1106
1116
|
options[:template] = opt[:template] || nil
|
|
1107
1117
|
end
|
|
1108
1118
|
|
|
1109
|
-
output = list_section(options) # hooked
|
|
1119
|
+
output = list_section(options, items: export_items) # hooked
|
|
1110
1120
|
|
|
1111
1121
|
if opt[:save_to]
|
|
1112
1122
|
file = File.expand_path(opt[:save_to])
|
|
@@ -1183,6 +1193,19 @@ module Doing
|
|
|
1183
1193
|
|
|
1184
1194
|
raise NoResults, 'no items matched your search' if items.empty?
|
|
1185
1195
|
|
|
1196
|
+
if opt[:tags].empty? && !opt[:autotag]
|
|
1197
|
+
completions = opt[:remove] ? all_tags(items) : all_tags(@content)
|
|
1198
|
+
if opt[:remove]
|
|
1199
|
+
puts "#{yellow}Available tags: #{boldwhite}#{completions.map(&:add_at).join(', ')}"
|
|
1200
|
+
else
|
|
1201
|
+
puts "#{yellow}Use tab to complete known tags"
|
|
1202
|
+
end
|
|
1203
|
+
opt[:tags] = Doing::Prompt.read_line(prompt: "Enter tag(s) to #{opt[:remove] ? 'remove' : 'add'}",
|
|
1204
|
+
completions: completions,
|
|
1205
|
+
default_response: '').to_tags
|
|
1206
|
+
raise UserCancelled, 'No tags provided' if opt[:tags].empty?
|
|
1207
|
+
end
|
|
1208
|
+
|
|
1186
1209
|
items.each do |item|
|
|
1187
1210
|
added = []
|
|
1188
1211
|
removed = []
|
|
@@ -2126,6 +2149,13 @@ EOS
|
|
|
2126
2149
|
false
|
|
2127
2150
|
end
|
|
2128
2151
|
|
|
2152
|
+
##
|
|
2153
|
+
## Load configuration files and updated the @config
|
|
2154
|
+
## attribute with a Doing::Configuration object
|
|
2155
|
+
##
|
|
2156
|
+
## @param filename [String] (optional) path to
|
|
2157
|
+
## alternative config file
|
|
2158
|
+
##
|
|
2129
2159
|
def configure(filename = nil)
|
|
2130
2160
|
if filename
|
|
2131
2161
|
Doing.config_with(filename, { ignore_local: true })
|
data/lib/doing.rb
CHANGED
|
@@ -10,6 +10,11 @@ require 'tempfile'
|
|
|
10
10
|
require 'zlib'
|
|
11
11
|
require 'base64'
|
|
12
12
|
require 'plist'
|
|
13
|
+
require 'readline'
|
|
14
|
+
require 'haml'
|
|
15
|
+
require 'json'
|
|
16
|
+
require 'logger'
|
|
17
|
+
require 'safe_yaml/load'
|
|
13
18
|
|
|
14
19
|
require 'chronic'
|
|
15
20
|
require 'tty-link'
|
|
@@ -17,10 +22,6 @@ require 'tty-which'
|
|
|
17
22
|
require 'tty-markdown'
|
|
18
23
|
require 'tty-reader'
|
|
19
24
|
require 'tty-screen'
|
|
20
|
-
require 'haml'
|
|
21
|
-
require 'json'
|
|
22
|
-
require 'logger'
|
|
23
|
-
require 'safe_yaml/load'
|
|
24
25
|
|
|
25
26
|
require_relative 'doing/hash'
|
|
26
27
|
require_relative 'doing/colors'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: doing
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.16
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brett Terpstra
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-01-
|
|
11
|
+
date: 2022-01-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: safe_yaml
|