doing 2.1.89 → 2.1.91
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/.irbrc +2 -0
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +251 -0
- data/CHANGELOG.md +26 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/Rakefile +5 -3
- data/bin/commands/changes.rb +3 -1
- data/bin/commands/choose.rb +2 -0
- data/bin/commands/colors.rb +5 -3
- data/bin/commands/commands_accepting.rb +3 -3
- data/bin/commands/completion.rb +2 -1
- data/bin/commands/config.rb +8 -6
- data/bin/commands/done.rb +19 -12
- data/bin/commands/finish.rb +4 -2
- data/bin/commands/grep.rb +9 -5
- data/bin/commands/import.rb +14 -11
- data/bin/commands/install_fzf.rb +4 -2
- data/bin/commands/last.rb +31 -27
- data/bin/commands/meanwhile.rb +6 -2
- data/bin/commands/note.rb +6 -3
- data/bin/commands/now.rb +2 -0
- data/bin/commands/open.rb +6 -1
- data/bin/commands/plugins.rb +2 -0
- data/bin/commands/recent.rb +47 -33
- data/bin/commands/reset.rb +7 -3
- data/bin/commands/rotate.rb +6 -3
- data/bin/commands/sections.rb +3 -3
- data/bin/commands/select.rb +2 -0
- data/bin/commands/show.rb +24 -20
- data/bin/commands/since.rb +10 -3
- data/bin/commands/tag.rb +18 -16
- data/bin/commands/tag_dir.rb +5 -2
- data/bin/commands/tags.rb +17 -17
- data/bin/commands/template.rb +8 -2
- data/bin/commands/today.rb +10 -2
- data/bin/commands/undo.rb +2 -0
- data/bin/commands/update.rb +9 -7
- data/bin/commands/view.rb +11 -8
- data/bin/commands/views.rb +2 -0
- data/bin/commands/yesterday.rb +6 -1
- data/bin/doing +54 -57
- data/docs/doc/Array.html +3 -3
- data/docs/doc/BooleanTermParser/Clause.html +3 -3
- data/docs/doc/BooleanTermParser/Operator.html +3 -3
- data/docs/doc/BooleanTermParser/Query.html +3 -3
- data/docs/doc/BooleanTermParser/QueryParser.html +3 -3
- data/docs/doc/BooleanTermParser/QueryTransformer.html +3 -3
- data/docs/doc/BooleanTermParser.html +3 -3
- data/docs/doc/Doing/ArrayCleanup.html +3 -3
- data/docs/doc/Doing/ArrayNestedHash.html +3 -3
- data/docs/doc/Doing/ArrayTags.html +9 -9
- data/docs/doc/Doing/ByDayExport.html +3 -3
- data/docs/doc/Doing/CSVExport.html +4 -4
- data/docs/doc/Doing/CalendarImport.html +4 -4
- data/docs/doc/Doing/Change.html +3 -3
- data/docs/doc/Doing/Changes.html +3 -3
- data/docs/doc/Doing/ChronifyArray.html +3 -3
- data/docs/doc/Doing/ChronifyNumeric.html +3 -3
- data/docs/doc/Doing/ChronifyString.html +6 -6
- data/docs/doc/Doing/Color.html +88 -47
- data/docs/doc/Doing/Completion/BashCompletions.html +3 -3
- data/docs/doc/Doing/Completion/FigCompletions.html +3 -3
- data/docs/doc/Doing/Completion/FishCompletions.html +3 -3
- data/docs/doc/Doing/Completion/StringUtils.html +3 -3
- data/docs/doc/Doing/Completion/ZshCompletions.html +3 -3
- data/docs/doc/Doing/Completion.html +5 -5
- data/docs/doc/Doing/Configuration.html +6 -6
- data/docs/doc/Doing/DayOneRenderer.html +3 -3
- data/docs/doc/Doing/DayoneExport.html +4 -4
- data/docs/doc/Doing/DoingExport.html +5 -5
- data/docs/doc/Doing/DoingImport.html +4 -4
- data/docs/doc/Doing/Entry.html +3 -3
- data/docs/doc/Doing/Errors/DoingNoTraceError.html +3 -3
- data/docs/doc/Doing/Errors/DoingRuntimeError.html +3 -3
- data/docs/doc/Doing/Errors/DoingStandardError.html +3 -3
- data/docs/doc/Doing/Errors/EmptyInput.html +3 -3
- data/docs/doc/Doing/Errors/HistoryLimitError.html +3 -3
- data/docs/doc/Doing/Errors/InvalidPlugin.html +3 -3
- data/docs/doc/Doing/Errors/MissingBackupFile.html +3 -3
- data/docs/doc/Doing/Errors/NoResults.html +3 -3
- data/docs/doc/Doing/Errors/PluginException.html +3 -3
- data/docs/doc/Doing/Errors/UserCancelled.html +3 -3
- data/docs/doc/Doing/Errors/WrongCommand.html +3 -3
- data/docs/doc/Doing/Errors.html +3 -3
- data/docs/doc/Doing/HTMLExport.html +4 -4
- data/docs/doc/Doing/Hooks.html +3 -16
- data/docs/doc/Doing/Item.html +4 -4
- data/docs/doc/Doing/ItemDates.html +3 -3
- data/docs/doc/Doing/ItemQuery.html +3 -3
- data/docs/doc/Doing/ItemState.html +3 -3
- data/docs/doc/Doing/ItemTags.html +3 -3
- data/docs/doc/Doing/Items.html +3 -3
- data/docs/doc/Doing/JSONExport.html +4 -4
- data/docs/doc/Doing/JSONImport.html +4 -4
- data/docs/doc/Doing/Logger.html +183 -3
- data/docs/doc/Doing/MarkdownExport.html +4 -4
- data/docs/doc/Doing/Note.html +3 -3
- data/docs/doc/Doing/Pager.html +54 -58
- data/docs/doc/Doing/Plugins.html +3 -3
- data/docs/doc/Doing/Prompt.html +4 -4
- data/docs/doc/Doing/PromptChoose.html +3 -3
- data/docs/doc/Doing/PromptFZF.html +3 -3
- data/docs/doc/Doing/PromptInput.html +3 -3
- data/docs/doc/Doing/PromptSTD.html +3 -3
- data/docs/doc/Doing/PromptYN.html +3 -3
- data/docs/doc/Doing/Section.html +3 -3
- data/docs/doc/Doing/StringHighlight.html +3 -3
- data/docs/doc/Doing/StringNormalize.html +3 -3
- data/docs/doc/Doing/StringQuery.html +4 -4
- data/docs/doc/Doing/StringTags.html +3 -3
- data/docs/doc/Doing/StringTransform.html +3 -3
- data/docs/doc/Doing/StringTruncate.html +3 -3
- data/docs/doc/Doing/StringURL.html +3 -3
- data/docs/doc/Doing/SymbolNormalize.html +5 -5
- data/docs/doc/Doing/TaskPaperExport.html +4 -4
- data/docs/doc/Doing/TemplateExport.html +5 -5
- data/docs/doc/Doing/TemplateString.html +7 -7
- data/docs/doc/Doing/TimingImport.html +4 -4
- data/docs/doc/Doing/Types.html +3 -3
- data/docs/doc/Doing/Util/Backup.html +4 -17
- data/docs/doc/Doing/Util.html +56 -61
- data/docs/doc/Doing/Version.html +3 -3
- data/docs/doc/Doing/WWID.html +6 -4
- data/docs/doc/Doing.html +4 -4
- data/docs/doc/FalseClass.html +3 -3
- data/docs/doc/GLI/Commands/Help.html +5 -5
- data/docs/doc/GLI/Commands/MarkdownDocumentListener.html +3 -3
- data/docs/doc/GLI/Commands.html +3 -3
- data/docs/doc/GLI.html +3 -3
- data/docs/doc/Hash.html +4 -4
- data/docs/doc/Numeric.html +3 -3
- data/docs/doc/Object.html +3 -3
- data/docs/doc/PhraseParser/Operator.html +3 -3
- data/docs/doc/PhraseParser/PhraseClause.html +3 -3
- data/docs/doc/PhraseParser/Query.html +3 -3
- data/docs/doc/PhraseParser/QueryParser.html +3 -3
- data/docs/doc/PhraseParser/QueryTransformer.html +3 -3
- data/docs/doc/PhraseParser/TermClause.html +3 -3
- data/docs/doc/PhraseParser.html +3 -3
- data/docs/doc/Status.html +3 -3
- data/docs/doc/String.html +51 -5
- data/docs/doc/Symbol.html +3 -3
- data/docs/doc/Time.html +3 -3
- data/docs/doc/TrueClass.html +3 -3
- data/docs/doc/_index.html +4 -4
- data/docs/doc/class_list.html +6 -3
- data/docs/doc/css/full_list.css +3 -3
- data/docs/doc/css/style.css +6 -0
- data/docs/doc/file.README.html +4 -4
- data/docs/doc/file_list.html +5 -2
- data/docs/doc/frames.html +1 -1
- data/docs/doc/index.html +4 -4
- data/docs/doc/js/app.js +294 -264
- data/docs/doc/js/full_list.js +30 -4
- data/docs/doc/method_list.html +443 -392
- data/docs/doc/top-level-namespace.html +3 -3
- data/doing.gemspec +2 -0
- data/doing.rdoc +1 -30
- data/example_plugin.rb +1 -4
- data/lib/completion/_doing.zsh +0 -4
- data/lib/completion/doing.bash +0 -11
- data/lib/completion/doing.fish +0 -5
- data/lib/completion/doing.ts +0 -40
- data/lib/doing/add_options.rb +2 -2
- data/lib/doing/array/cleanup.rb +2 -0
- data/lib/doing/array/nested_hash.rb +2 -0
- data/lib/doing/boolean_term_parser.rb +3 -3
- data/lib/doing/changelog/changes.rb +4 -5
- data/lib/doing/changelog/version.rb +8 -11
- data/lib/doing/chronify/array.rb +4 -4
- data/lib/doing/chronify/string.rb +5 -4
- data/lib/doing/cli_status.rb +7 -2
- data/lib/doing/colors.rb +93 -51
- data/lib/doing/completion/bash_completion.rb +36 -39
- data/lib/doing/completion/completion_string.rb +2 -1
- data/lib/doing/completion/fig_completion.rb +33 -33
- data/lib/doing/completion/fish_completion.rb +22 -23
- data/lib/doing/completion/zsh_completion.rb +5 -5
- data/lib/doing/completion.rb +7 -4
- data/lib/doing/configuration.rb +21 -13
- data/lib/doing/errors.rb +1 -4
- data/lib/doing/good.rb +1 -1
- data/lib/doing/hash.rb +4 -4
- data/lib/doing/help_monkey_patch.rb +1 -1
- data/lib/doing/hooks.rb +6 -2
- data/lib/doing/item/dates.rb +3 -1
- data/lib/doing/item/item.rb +1 -1
- data/lib/doing/item/query.rb +14 -14
- data/lib/doing/item/state.rb +2 -0
- data/lib/doing/logger.rb +113 -45
- data/lib/doing/markdown_document_listener.rb +25 -25
- data/lib/doing/normalize.rb +1 -1
- data/lib/doing/pager.rb +73 -29
- data/lib/doing/plugin_manager.rb +4 -5
- data/lib/doing/plugins/export/byday.rb +1 -1
- data/lib/doing/plugins/export/dayone_export.rb +28 -27
- data/lib/doing/plugins/export/doing_export.rb +1 -1
- data/lib/doing/plugins/export/html_export.rb +3 -3
- data/lib/doing/plugins/export/json_export.rb +4 -5
- data/lib/doing/plugins/export/markdown_export.rb +10 -2
- data/lib/doing/plugins/export/taskpaper_export.rb +1 -0
- data/lib/doing/plugins/export/template_export.rb +110 -107
- data/lib/doing/plugins/import/calendar_import.rb +1 -1
- data/lib/doing/plugins/import/doing_import.rb +2 -2
- data/lib/doing/plugins/import/timing_import.rb +3 -3
- data/lib/doing/prompt/choose.rb +5 -6
- data/lib/doing/prompt/fzf.rb +3 -2
- data/lib/doing/prompt/input.rb +10 -9
- data/lib/doing/prompt/yn.rb +9 -11
- data/lib/doing/string/tags.rb +7 -4
- data/lib/doing/string/transform.rb +15 -10
- data/lib/doing/string/truncate.rb +1 -0
- data/lib/doing/string/url.rb +1 -1
- data/lib/doing/template_string.rb +13 -9
- data/lib/doing/time.rb +4 -2
- data/lib/doing/util.rb +12 -11
- data/lib/doing/util_backup.rb +29 -26
- data/lib/doing/version.rb +3 -1
- data/lib/doing/wwid/display.rb +182 -151
- data/lib/doing/wwid/editor.rb +13 -12
- data/lib/doing/wwid/filetools.rb +13 -11
- data/lib/doing/wwid/filter.rb +41 -40
- data/lib/doing/wwid/guess.rb +6 -8
- data/lib/doing/wwid/interactive.rb +10 -10
- data/lib/doing/wwid/modify.rb +55 -55
- data/lib/doing/wwid/timers.rb +4 -5
- data/lib/doing/wwid/wwid.rb +0 -0
- data/lib/doing/wwid/wwidutil.rb +8 -10
- data/lib/examples/commands/wiki.rb +2 -0
- data/lib/examples/plugins/capture_thing_import.rb +1 -1
- data/lib/examples/plugins/say_export.rb +1 -2
- data/lib/examples/plugins/wiki_export/wiki_export.rb +3 -4
- data/lib/helpers/fzf/test/test_go.rb +5 -5
- data/lib/helpers/threaded_tests.rb +20 -20
- data/lib/helpers/threaded_tests_string.rb +2 -0
- data/rdoc_to_mmd.rb +5 -4
- data/rdocfixer.rb +1 -2
- data/scripts/deploy.rb +3 -4
- data/scripts/generate_bash_completions.rb +40 -43
- data/scripts/generate_fish_completions.rb +17 -15
- data/scripts/generate_zsh_completions.rb +9 -7
- data/scripts/setting_replace.rb +1 -0
- data/scripts/sort_commands.rb +4 -2
- data/yard_templates/default/method_details/setup.rb +3 -1
- metadata +3 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>
|
|
7
7
|
Top Level Namespace
|
|
8
8
|
|
|
9
|
-
— Documentation by YARD 0.9.
|
|
9
|
+
— Documentation by YARD 0.9.37
|
|
10
10
|
|
|
11
11
|
</title>
|
|
12
12
|
|
|
@@ -216,9 +216,9 @@
|
|
|
216
216
|
</div>
|
|
217
217
|
|
|
218
218
|
<div id="footer">
|
|
219
|
-
Generated on
|
|
219
|
+
Generated on Fri Dec 5 16:12:00 2025 by
|
|
220
220
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
221
|
-
0.9.
|
|
221
|
+
0.9.37 (ruby-3.4.4).
|
|
222
222
|
</div>
|
|
223
223
|
|
|
224
224
|
</div>
|
data/doing.gemspec
CHANGED
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.91
|
|
9
9
|
|
|
10
10
|
=== Global Options
|
|
11
11
|
=== --config_file arg
|
|
@@ -1289,35 +1289,6 @@ Force exact search string matching (case sensitive)
|
|
|
1289
1289
|
|
|
1290
1290
|
|
|
1291
1291
|
|
|
1292
|
-
==== Command: <tt>later ENTRY</tt>
|
|
1293
|
-
Add an item to the Later section
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
===== Options
|
|
1297
|
-
===== -b|--back|--started DATE_STRING
|
|
1298
|
-
|
|
1299
|
-
Backdate start time to date string [4pm|20m|2h|yesterday noon]
|
|
1300
|
-
|
|
1301
|
-
[Default Value] None
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
===== -n|--note TEXT
|
|
1305
|
-
|
|
1306
|
-
Note
|
|
1307
|
-
|
|
1308
|
-
[Default Value] None
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
===== --ask
|
|
1312
|
-
Prompt for note via multi-line input
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
===== -e|--editor
|
|
1317
|
-
Edit entry with vim
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
1292
|
==== Command: <tt>mark|flag </tt>
|
|
1322
1293
|
Mark last entry as flagged
|
|
1323
1294
|
|
data/example_plugin.rb
CHANGED
|
@@ -83,7 +83,6 @@ module Doing
|
|
|
83
83
|
}
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
-
|
|
87
86
|
#-------------------------------------------------------
|
|
88
87
|
## Output a template. Only required if template(s) are
|
|
89
88
|
## included in settings. The method should return a
|
|
@@ -106,7 +105,6 @@ module Doing
|
|
|
106
105
|
'On %date, you were %title, recorded in section %section%took'
|
|
107
106
|
end
|
|
108
107
|
|
|
109
|
-
|
|
110
108
|
##
|
|
111
109
|
## Render data received from an output
|
|
112
110
|
## command
|
|
@@ -122,7 +120,7 @@ module Doing
|
|
|
122
120
|
##
|
|
123
121
|
## @return [String] Rendered output
|
|
124
122
|
##
|
|
125
|
-
def self.render(
|
|
123
|
+
def self.render(_wwid, items, variables: {})
|
|
126
124
|
return unless items.good?
|
|
127
125
|
|
|
128
126
|
config = Doing.config.settings
|
|
@@ -154,7 +152,6 @@ module Doing
|
|
|
154
152
|
finished_at = i.end_date
|
|
155
153
|
took += finished_at.strftime('%A %B %e at %I:%M%p')
|
|
156
154
|
|
|
157
|
-
|
|
158
155
|
took += ' and it took'
|
|
159
156
|
took += interval.time_string(format: :natural)
|
|
160
157
|
end
|
data/lib/completion/_doing.zsh
CHANGED
|
@@ -27,7 +27,6 @@ function _doing() {
|
|
|
27
27
|
'help:Shows a list of commands or help for one command'
|
|
28
28
|
'import:Import entries from an external source'
|
|
29
29
|
'last:Show the last entry'
|
|
30
|
-
'later:Add an item to the Later section'
|
|
31
30
|
'mark:Mark last entry as flagged'
|
|
32
31
|
'flag:Mark last entry as flagged'
|
|
33
32
|
'meanwhile:Finish any running @meanwhile tasks and optionally create a new one'
|
|
@@ -128,9 +127,6 @@ function _doing() {
|
|
|
128
127
|
last)
|
|
129
128
|
args=( "--bool[Boolean used to combine multiple tags]:BOOLEAN:" "--case[Case sensitivity for search string matching [(c)ase-sensitive]:TYPE:" "--config_template[Output using a template from configuration]:TEMPLATE_KEY:" {'(--delete)-d','(-d)--delete'}"[Delete the last entry]" "--duration[Show elapsed time if entry is not tagged @done]" {'(--editor)-e','(-e)--editor'}"[Edit entry with vim]" {'(--hilite)-h','(-h)--hilite'}"[Highlight search matches in output]" "--not[Show items that *don't* match search/tag filters]" {'(--output)-o','(-o)--output'}"[Output to export format]:FORMAT:" {'(--section)-s','(-s)--section'}"[Specify a section]:NAME:" "--save[Save all current command line options as a new view]:VIEW_NAME:" "--search[Filter entries using a search query]:QUERY:" "--tag[Filter entries by tag]:TAG:" "--template[Override output format with a template string containing %placeholders]:TEMPLATE_STRING:" "--title[Title string to be used for output formats that require it]:TITLE:" "--val[Perform a tag value query]:QUERY:" {'(--exact)-x','(-x)--exact'}"[Force exact search string matching]" )
|
|
130
129
|
;;
|
|
131
|
-
later)
|
|
132
|
-
args=( "--ask[Prompt for note via multi-line input]" "--started[Backdate start time to date string [4pm|20m|2h|yesterday noon]]:DATE_STRING:" {'(--editor)-e','(-e)--editor'}"[Edit entry with vim]" {'(--note)-n','(-n)--note'}"[Note]:TEXT:" )
|
|
133
|
-
;;
|
|
134
130
|
mark)
|
|
135
131
|
args=( "--bool[Boolean used to combine multiple tags]:BOOLEAN:" {'(--count)-c','(-c)--count'}"[How many recent entries to tag]:COUNT:" "--case[Case sensitivity for search string matching [(c)ase-sensitive]:TYPE:" {'(--date)-d','(-d)--date'}"[Include current date/time with tag]" "--force[Don't ask permission to flag all entries when count is 0]" {'(--interactive)-i','(-i)--interactive'}"[Select item(s) to flag from a menu of matching entries]" "--not[Flag items that *don't* match search/tag filters]" {'(--remove)-r','(-r)--remove'}"[Remove flag]" {'(--section)-s','(-s)--section'}"[Section]:SECTION_NAME:" "--search[Filter entries using a search query]:QUERY:" "--tag[Filter entries by tag]:TAG:" {'(--unfinished)-u','(-u)--unfinished'}"[Flag last entry]" "--val[Perform a tag value query]:QUERY:" {'(--exact)-x','(-x)--exact'}"[Force exact search string matching]" )
|
|
136
132
|
;;
|
data/lib/completion/doing.bash
CHANGED
|
@@ -148,16 +148,6 @@ _doing_last() {
|
|
|
148
148
|
fi
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
_doing_later() {
|
|
152
|
-
|
|
153
|
-
if [[ "$token" == --* ]]; then
|
|
154
|
-
COMPREPLY=( $( compgen -W '--ask --started --editor --note' -- $token ) )
|
|
155
|
-
elif [[ "$token" == -* ]]; then
|
|
156
|
-
COMPREPLY=( $( compgen -W '-e -n --ask --started --editor --note' -- $token ) )
|
|
157
|
-
|
|
158
|
-
fi
|
|
159
|
-
}
|
|
160
|
-
|
|
161
151
|
_doing_mark() {
|
|
162
152
|
|
|
163
153
|
if [[ "$token" == --* ]]; then
|
|
@@ -476,7 +466,6 @@ _doing()
|
|
|
476
466
|
elif [[ $last =~ (help) ]]; then _doing_help
|
|
477
467
|
elif [[ $last =~ (import) ]]; then _doing_import
|
|
478
468
|
elif [[ $last =~ (last) ]]; then _doing_last
|
|
479
|
-
elif [[ $last =~ (later) ]]; then _doing_later
|
|
480
469
|
elif [[ $last =~ (mark|flag) ]]; then _doing_mark
|
|
481
470
|
elif [[ $last =~ (meanwhile) ]]; then _doing_meanwhile
|
|
482
471
|
elif [[ $last =~ (note) ]]; then _doing_note
|
data/lib/completion/doing.fish
CHANGED
|
@@ -150,7 +150,6 @@ complete -xc doing -n '__fish_doing_needs_command' -a 'grep search' -d Search\ f
|
|
|
150
150
|
complete -xc doing -n '__fish_doing_needs_command' -a 'help' -d Shows\ a\ list\ of\ commands\ or\ help\ for\ one\ command
|
|
151
151
|
complete -xc doing -n '__fish_doing_needs_command' -a 'import' -d Import\ entries\ from\ an\ external\ source
|
|
152
152
|
complete -xc doing -n '__fish_doing_needs_command' -a 'last' -d Show\ the\ last\ entry
|
|
153
|
-
complete -xc doing -n '__fish_doing_needs_command' -a 'later' -d Add\ an\ item\ to\ the\ Later\ section
|
|
154
153
|
complete -xc doing -n '__fish_doing_needs_command' -a 'mark flag' -d Mark\ last\ entry\ as\ flagged
|
|
155
154
|
complete -xc doing -n '__fish_doing_needs_command' -a 'meanwhile' -d Finish\ any\ running\ @meanwhile\ tasks\ and\ optionally\ create\ a\ new\ one
|
|
156
155
|
complete -xc doing -n '__fish_doing_needs_command' -a 'note' -d Add\ a\ note\ to\ the\ last\ entry
|
|
@@ -328,10 +327,6 @@ complete -c doing -l template -f -r -n '__fish_doing_using_command last' -d Ove
|
|
|
328
327
|
complete -c doing -l title -f -r -n '__fish_doing_using_command last' -d Title\ string\ to\ be\ used\ for\ output\ formats\ that\ require\ it
|
|
329
328
|
complete -c doing -l val -f -r -n '__fish_doing_using_command last' -d Perform\ a\ tag\ value\ query
|
|
330
329
|
complete -c doing -l exact -s x -f -n '__fish_doing_using_command last' -d Force\ exact\ search\ string\ matching
|
|
331
|
-
complete -c doing -l ask -f -n '__fish_doing_using_command later' -d Prompt\ for\ note\ via\ multi-line\ input
|
|
332
|
-
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\]
|
|
333
|
-
complete -c doing -l editor -s e -f -n '__fish_doing_using_command later' -d Edit\ entry\ with\ vim
|
|
334
|
-
complete -c doing -l note -s n -f -r -n '__fish_doing_using_command later' -d Note
|
|
335
330
|
complete -c doing -l bool -f -r -n '__fish_doing_using_command mark flag' -d Boolean\ used\ to\ combine\ multiple\ tags
|
|
336
331
|
complete -c doing -l count -s c -f -r -n '__fish_doing_using_command mark flag' -d How\ many\ recent\ entries\ to\ tag
|
|
337
332
|
complete -c doing -l case -f -r -n '__fish_doing_using_command mark flag' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
|
data/lib/completion/doing.ts
CHANGED
|
@@ -2023,46 +2023,6 @@ const completionSpec: Fig.Spec = {
|
|
|
2023
2023
|
|
|
2024
2024
|
},
|
|
2025
2025
|
|
|
2026
|
-
{
|
|
2027
|
-
name: "later",
|
|
2028
|
-
description: "Add an item to the Later section",
|
|
2029
|
-
options: [
|
|
2030
|
-
{
|
|
2031
|
-
name: ["--ask"],
|
|
2032
|
-
description: "Prompt for note via multi-line input",
|
|
2033
|
-
|
|
2034
|
-
},
|
|
2035
|
-
|
|
2036
|
-
{
|
|
2037
|
-
name: ["--started"],
|
|
2038
|
-
description: "Backdate start time to date string [4pm|20m|2h|yesterday noon]",
|
|
2039
|
-
args: {
|
|
2040
|
-
name: "DATE_STRING",
|
|
2041
|
-
description: "DATE_STRING",
|
|
2042
|
-
},
|
|
2043
|
-
|
|
2044
|
-
},
|
|
2045
|
-
|
|
2046
|
-
{
|
|
2047
|
-
name: ["-e", "--editor"],
|
|
2048
|
-
description: "Edit entry with vim",
|
|
2049
|
-
|
|
2050
|
-
},
|
|
2051
|
-
|
|
2052
|
-
{
|
|
2053
|
-
name: ["-n", "--note"],
|
|
2054
|
-
description: "Note",
|
|
2055
|
-
args: {
|
|
2056
|
-
name: "TEXT",
|
|
2057
|
-
description: "TEXT",
|
|
2058
|
-
},
|
|
2059
|
-
|
|
2060
|
-
},
|
|
2061
|
-
|
|
2062
|
-
],
|
|
2063
|
-
|
|
2064
|
-
},
|
|
2065
|
-
|
|
2066
2026
|
{
|
|
2067
2027
|
name: "mark",
|
|
2068
2028
|
description: "Mark last entry as flagged",
|
data/lib/doing/add_options.rb
CHANGED
|
@@ -45,7 +45,7 @@ def add_options(type, cmd, default_template: 'default')
|
|
|
45
45
|
cmd.arg_name 'FORMAT'
|
|
46
46
|
cmd.flag %i[o output], type: ExportTemplate
|
|
47
47
|
|
|
48
|
-
cmd.desc
|
|
48
|
+
cmd.desc 'Output using a template from configuration'
|
|
49
49
|
cmd.arg_name 'TEMPLATE_KEY'
|
|
50
50
|
cmd.flag [:config_template], type: TemplateName, default_value: default_template
|
|
51
51
|
|
|
@@ -57,7 +57,7 @@ def add_options(type, cmd, default_template: 'default')
|
|
|
57
57
|
cmd.arg_name 'FORMAT'
|
|
58
58
|
cmd.flag %i[o output]
|
|
59
59
|
|
|
60
|
-
cmd.desc
|
|
60
|
+
cmd.desc 'Output using a template from configuration'
|
|
61
61
|
cmd.arg_name 'TEMPLATE_KEY'
|
|
62
62
|
cmd.flag [:config_template], type: TemplateName
|
|
63
63
|
|
data/lib/doing/array/cleanup.rb
CHANGED
|
@@ -15,10 +15,10 @@ module BooleanTermParser
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
class QueryTransformer < Parslet::Transform
|
|
18
|
-
rule(:
|
|
18
|
+
rule(clause: subtree(:clause)) do
|
|
19
19
|
Clause.new(clause[:operator]&.to_s, clause[:term].to_s)
|
|
20
20
|
end
|
|
21
|
-
rule(:
|
|
21
|
+
rule(query: sequence(:clauses)) { Query.new(clauses) }
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
class Operator
|
|
@@ -49,7 +49,7 @@ module BooleanTermParser
|
|
|
49
49
|
attr_accessor :should_terms, :must_not_terms, :must_terms
|
|
50
50
|
|
|
51
51
|
def initialize(clauses)
|
|
52
|
-
grouped = clauses.chunk
|
|
52
|
+
grouped = clauses.chunk(&:operator).to_h
|
|
53
53
|
self.should_terms = grouped.fetch(:should, []).map(&:term)
|
|
54
54
|
self.must_not_terms = grouped.fetch(:must_not, []).map(&:term)
|
|
55
55
|
self.must_terms = grouped.fetch(:must, []).map(&:term)
|
|
@@ -6,7 +6,8 @@ module Doing
|
|
|
6
6
|
attr_reader :changes
|
|
7
7
|
attr_writer :changes_only
|
|
8
8
|
|
|
9
|
-
def initialize(lookup: nil, search: nil, changes: false, sort: :desc, prefix: false,
|
|
9
|
+
def initialize(lookup: nil, search: nil, changes: false, sort: :desc, prefix: false,
|
|
10
|
+
only: %i[changed new improved fixed])
|
|
10
11
|
@changes_only = changes
|
|
11
12
|
@prefix = prefix
|
|
12
13
|
@only = only
|
|
@@ -28,7 +29,7 @@ module Doing
|
|
|
28
29
|
end
|
|
29
30
|
|
|
30
31
|
def versions
|
|
31
|
-
@changes.select { |change| change.entries&.count
|
|
32
|
+
@changes.select { |change| change.entries&.count&.> 0 }.map(&:version)
|
|
32
33
|
end
|
|
33
34
|
|
|
34
35
|
def interactive
|
|
@@ -45,7 +46,7 @@ module Doing
|
|
|
45
46
|
|
|
46
47
|
def to_s
|
|
47
48
|
if @changes_only
|
|
48
|
-
@changes.map(&:changes_only).delete_if(&:empty?).join
|
|
49
|
+
@changes.map(&:changes_only).delete_if(&:empty?).join.gsub(/\n+/, "\n").force_encoding('utf-8')
|
|
49
50
|
else
|
|
50
51
|
@changes.map(&:to_s).join("\n\n").force_encoding('utf-8')
|
|
51
52
|
end
|
|
@@ -67,8 +68,6 @@ module Doing
|
|
|
67
68
|
end
|
|
68
69
|
|
|
69
70
|
def lookup(lookup_version)
|
|
70
|
-
range = []
|
|
71
|
-
|
|
72
71
|
if lookup_version =~ /([\d.]+) *(?:-|to)+ *([\d.]+)/
|
|
73
72
|
m = Regexp.last_match
|
|
74
73
|
lookup("> #{m[1]}")
|
|
@@ -36,7 +36,6 @@ module Doing
|
|
|
36
36
|
val.is_a?(String)
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
|
|
40
39
|
def compare(other, comp, inclusive: false)
|
|
41
40
|
case comp
|
|
42
41
|
when :older
|
|
@@ -81,18 +80,16 @@ module Doing
|
|
|
81
80
|
true
|
|
82
81
|
elsif wild?(other.min)
|
|
83
82
|
@min.to_s =~ /^#{other.min}/ ? true : false
|
|
84
|
-
|
|
85
|
-
if
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
@patch.to_s =~ /^#{other.patch}/ ? true : false
|
|
90
|
-
else
|
|
91
|
-
@patch == other.patch
|
|
92
|
-
end
|
|
83
|
+
elsif @min == other.min
|
|
84
|
+
if other.patch.nil?
|
|
85
|
+
true
|
|
86
|
+
elsif wild?(other.patch)
|
|
87
|
+
@patch.to_s =~ /^#{other.patch}/ ? true : false
|
|
93
88
|
else
|
|
94
|
-
|
|
89
|
+
@patch == other.patch
|
|
95
90
|
end
|
|
91
|
+
else
|
|
92
|
+
false
|
|
96
93
|
end
|
|
97
94
|
end
|
|
98
95
|
end
|
data/lib/doing/chronify/array.rb
CHANGED
|
@@ -9,12 +9,12 @@ module Doing
|
|
|
9
9
|
|
|
10
10
|
if d.zero? && h > 24
|
|
11
11
|
d = (h / 24).floor
|
|
12
|
-
h
|
|
12
|
+
h %= 24
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
if d > 365
|
|
16
16
|
y = (d / 365).floor
|
|
17
|
-
d
|
|
17
|
+
d %= 365
|
|
18
18
|
else
|
|
19
19
|
y = 0
|
|
20
20
|
end
|
|
@@ -41,7 +41,7 @@ module Doing
|
|
|
41
41
|
|
|
42
42
|
if d.zero? && h > 24
|
|
43
43
|
d = (h / 24).floor
|
|
44
|
-
h
|
|
44
|
+
h %= 24
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
@@ -68,7 +68,7 @@ module Doing
|
|
|
68
68
|
when :clock
|
|
69
69
|
if d.zero? && h > 24
|
|
70
70
|
d = (h / 24).floor
|
|
71
|
-
h
|
|
71
|
+
h %= 24
|
|
72
72
|
end
|
|
73
73
|
format('%<d>02d:%<h>02d:%<m>02d', d: d, h: h, m: m)
|
|
74
74
|
when :hmclock
|
|
@@ -43,8 +43,10 @@ module Doing
|
|
|
43
43
|
Doing.logger.debug('Parser:', %(date/time string "#{self}" interpreted as #{res} (#{secs_ago} seconds ago)))
|
|
44
44
|
else
|
|
45
45
|
date_string = dup
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
if date_string.match(Types::REGEX_DAY) && now.strftime('%a') =~ /^#{Regexp.last_match(1)}/i
|
|
47
|
+
date_string = 'today'
|
|
48
|
+
end
|
|
49
|
+
date_string = "#{options[:context]} #{date_string}" if date_string =~ Types::REGEX_TIME && options[:context]
|
|
48
50
|
|
|
49
51
|
res = Chronic.parse(date_string, {
|
|
50
52
|
guess: options.fetch(:guess, :begin),
|
|
@@ -69,7 +71,7 @@ module Doing
|
|
|
69
71
|
##
|
|
70
72
|
def chronify_qty
|
|
71
73
|
minutes = 0
|
|
72
|
-
case
|
|
74
|
+
case strip
|
|
73
75
|
when /^(\d+):(\d\d)$/
|
|
74
76
|
minutes += Regexp.last_match(1).to_i * 60
|
|
75
77
|
minutes += Regexp.last_match(2).to_i
|
|
@@ -212,7 +214,6 @@ module Doing
|
|
|
212
214
|
|
|
213
215
|
end
|
|
214
216
|
|
|
215
|
-
|
|
216
217
|
if start.is_a? String
|
|
217
218
|
Doing.logger.debug('Parser:',
|
|
218
219
|
"--from string interpreted as time span, from #{start || '12am'} to #{finish || '11:59pm'}")
|
data/lib/doing/cli_status.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Status
|
|
2
4
|
def cols
|
|
3
5
|
@cols ||= `tput cols`.strip.to_i
|
|
@@ -11,11 +13,14 @@ module Status
|
|
|
11
13
|
tail = tail.join(', ')
|
|
12
14
|
end
|
|
13
15
|
tail.ltrunc!(max_width)
|
|
14
|
-
$stderr.print format(
|
|
16
|
+
$stderr.print format(
|
|
17
|
+
"#{esc['kill']}#{esc['boldyellow']}> #{esc['boldgreen']}%s #{esc['white']}[#{esc['boldwhite']}%#{@commands.count.to_s.length}d#{esc['boldblack']}/#{esc['boldyellow']}%d#{esc['white']}]: #{esc['boldcyan']}%s#{esc['default']}\r", msg, idx, total, tail
|
|
18
|
+
)
|
|
15
19
|
end
|
|
16
20
|
|
|
17
21
|
def status(msg, reset: true, end_char: "\n")
|
|
18
|
-
$stderr.print format("#{esc['kill']}#{esc['boldyellow']}> #{esc['whiteboard']}%s#{esc['default']}%s", msg,
|
|
22
|
+
$stderr.print format("#{esc['kill']}#{esc['boldyellow']}> #{esc['whiteboard']}%s#{esc['default']}%s", msg,
|
|
23
|
+
reset ? "\r" : end_char)
|
|
19
24
|
end
|
|
20
25
|
|
|
21
26
|
def msg(msg, reset: true, color: 'green', end_char: "\n")
|
data/lib/doing/colors.rb
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
module Doing
|
|
5
5
|
# Terminal output color functions.
|
|
6
6
|
module Color
|
|
7
|
-
ESCAPE_REGEX =
|
|
7
|
+
ESCAPE_REGEX = /\e\[[0-9;]*m/.freeze
|
|
8
8
|
# All available color names. Available as methods and string extensions.
|
|
9
9
|
#
|
|
10
10
|
# @example Use a color as a method. Color reset will be added to end of string.
|
|
@@ -110,7 +110,9 @@ module Doing
|
|
|
110
110
|
compiled = ''
|
|
111
111
|
normalize_color.split('').each do |char|
|
|
112
112
|
compiled += char
|
|
113
|
-
|
|
113
|
+
if Color.attributes.include?(compiled.to_sym) || compiled =~ /^([fb]g?)?#([a-f0-9]{6})$/i
|
|
114
|
+
valid_color = compiled
|
|
115
|
+
end
|
|
114
116
|
end
|
|
115
117
|
|
|
116
118
|
valid_color
|
|
@@ -182,13 +184,49 @@ module Doing
|
|
|
182
184
|
escape += "\e[#{rgbf}m" if rgbf
|
|
183
185
|
escape + "\e[#{[fg, bg].delete_if(&:nil?).join(';')}m"
|
|
184
186
|
end
|
|
187
|
+
|
|
188
|
+
# Define string extension methods for all color attributes
|
|
189
|
+
ATTRIBUTES.each do |c, v|
|
|
190
|
+
new_method = <<-EOSCRIPT
|
|
191
|
+
def #{c}
|
|
192
|
+
result = ''
|
|
193
|
+
result << "\e[#{v}m" if Doing::Color.coloring?
|
|
194
|
+
result << self
|
|
195
|
+
result << "\e[0m" if Doing::Color.coloring?
|
|
196
|
+
result
|
|
197
|
+
end
|
|
198
|
+
EOSCRIPT
|
|
199
|
+
|
|
200
|
+
class_eval(new_method)
|
|
201
|
+
|
|
202
|
+
next unless c =~ /bold/
|
|
203
|
+
|
|
204
|
+
# Accept brightwhite in addition to boldwhite
|
|
205
|
+
new_method = <<-EOSCRIPT
|
|
206
|
+
def #{c.to_s.sub(/bold/, 'bright')}
|
|
207
|
+
result = ''
|
|
208
|
+
result << "\e[#{v}m" if Doing::Color.coloring?
|
|
209
|
+
result << self
|
|
210
|
+
result << "\e[0m" if Doing::Color.coloring?
|
|
211
|
+
result
|
|
212
|
+
end
|
|
213
|
+
EOSCRIPT
|
|
214
|
+
|
|
215
|
+
class_eval(new_method)
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Returns an uncolored version of the string, that is all
|
|
219
|
+
# ANSI-sequences are stripped from the string.
|
|
220
|
+
def uncolor
|
|
221
|
+
gsub(ESCAPE_REGEX, '')
|
|
222
|
+
end
|
|
185
223
|
end
|
|
186
224
|
|
|
187
225
|
class << self
|
|
188
226
|
# Returns true if the coloring function of this module
|
|
189
227
|
# is switched on, false otherwise.
|
|
190
228
|
def coloring?
|
|
191
|
-
@coloring
|
|
229
|
+
@coloring.nil? ? true : @coloring
|
|
192
230
|
end
|
|
193
231
|
|
|
194
232
|
attr_writer :coloring
|
|
@@ -236,51 +274,62 @@ module Doing
|
|
|
236
274
|
|
|
237
275
|
fmt.empty? ? input : format(fmt, colors)
|
|
238
276
|
end
|
|
239
|
-
end
|
|
240
277
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
278
|
+
ATTRIBUTES.each do |c, v|
|
|
279
|
+
new_method = <<-EOSCRIPT
|
|
280
|
+
def #{c}(string = nil)
|
|
281
|
+
result = ''
|
|
282
|
+
result << "\e[#{v}m" if Doing::Color.coloring?
|
|
283
|
+
if block_given?
|
|
284
|
+
result << yield
|
|
285
|
+
elsif string.respond_to?(:to_str)
|
|
286
|
+
result << string.to_str
|
|
287
|
+
elsif respond_to?(:to_str)
|
|
288
|
+
result << to_str
|
|
289
|
+
else
|
|
290
|
+
return result #only switch on
|
|
291
|
+
end
|
|
292
|
+
result << "\e[0m" if Doing::Color.coloring?
|
|
293
|
+
result
|
|
254
294
|
end
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
295
|
+
EOSCRIPT
|
|
296
|
+
|
|
297
|
+
module_eval(new_method)
|
|
298
|
+
|
|
299
|
+
next unless c =~ /bold/
|
|
300
|
+
|
|
301
|
+
# Accept brightwhite in addition to boldwhite
|
|
302
|
+
new_method = <<-EOSCRIPT
|
|
303
|
+
def #{c.to_s.sub(/bold/, 'bright')}(string = nil)
|
|
304
|
+
result = ''
|
|
305
|
+
result << "\e[#{v}m" if Doing::Color.coloring?
|
|
306
|
+
if block_given?
|
|
307
|
+
result << yield
|
|
308
|
+
elsif string.respond_to?(:to_str)
|
|
309
|
+
result << string.to_str
|
|
310
|
+
elsif respond_to?(:to_str)
|
|
311
|
+
result << to_str
|
|
312
|
+
else
|
|
313
|
+
return result #only switch on
|
|
314
|
+
end
|
|
315
|
+
result << "\e[0m" if Doing::Color.coloring?
|
|
316
|
+
result
|
|
277
317
|
end
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
318
|
+
EOSCRIPT
|
|
319
|
+
|
|
320
|
+
module_eval(new_method)
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
# Returns an array of all Doing::Color attributes as symbols.
|
|
324
|
+
def attributes
|
|
325
|
+
ATTRIBUTE_NAMES
|
|
326
|
+
end
|
|
282
327
|
|
|
283
|
-
|
|
328
|
+
# Returns an uncolored version of the string, that is all
|
|
329
|
+
# ANSI-sequences are stripped from the string.
|
|
330
|
+
def uncolor(string)
|
|
331
|
+
string.to_str.gsub(ESCAPE_REGEX, '')
|
|
332
|
+
end
|
|
284
333
|
end
|
|
285
334
|
|
|
286
335
|
def rgb(hex)
|
|
@@ -292,7 +341,6 @@ module Doing
|
|
|
292
341
|
%w[r g b].each do |e|
|
|
293
342
|
t << parts[e].hex
|
|
294
343
|
end
|
|
295
|
-
color =
|
|
296
344
|
"\e[#{is_bg ? '48' : '38'};2;#{t.join(';')}m"
|
|
297
345
|
end
|
|
298
346
|
|
|
@@ -309,11 +357,5 @@ module Doing
|
|
|
309
357
|
''
|
|
310
358
|
end
|
|
311
359
|
end
|
|
312
|
-
|
|
313
|
-
# Returns an array of all Doing::Color attributes as symbols.
|
|
314
|
-
def attributes
|
|
315
|
-
ATTRIBUTE_NAMES
|
|
316
|
-
end
|
|
317
|
-
extend self
|
|
318
360
|
end
|
|
319
361
|
end
|