doing 2.1.28 → 2.1.32
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/CHANGELOG.md +4962 -0
- data/Dockerfile-2.6 +3 -1
- data/Dockerfile-2.7 +4 -2
- data/Dockerfile-3.0 +3 -1
- data/Gemfile.lock +2 -67
- data/README.md +1 -1
- data/bash_profile +13 -0
- data/bin/commands/again.rb +1 -1
- data/bin/commands/archive.rb +3 -3
- data/bin/commands/cancel.rb +1 -1
- data/bin/commands/changes.rb +24 -14
- data/bin/commands/commands.rb +8 -8
- data/bin/commands/completion.rb +61 -19
- data/bin/commands/config.rb +20 -17
- data/bin/commands/done.rb +1 -1
- data/bin/commands/flag.rb +1 -1
- data/bin/commands/grep.rb +5 -5
- data/bin/commands/last.rb +1 -1
- data/bin/commands/meanwhile.rb +1 -1
- data/bin/commands/now.rb +1 -1
- data/bin/commands/on.rb +1 -1
- data/bin/commands/open.rb +4 -4
- data/bin/commands/recent.rb +4 -4
- data/bin/commands/show.rb +8 -8
- data/bin/commands/since.rb +1 -1
- data/bin/commands/tag_dir.rb +27 -3
- data/bin/commands/today.rb +1 -1
- data/bin/commands/view.rb +3 -3
- data/bin/commands/yesterday.rb +2 -2
- data/bin/doing +26 -135
- 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 +324 -4
- data/docs/doc/Doing/Configuration.html +3 -3
- 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 +125 -1
- data/docs/doc/Doing/Items.html +1 -1
- data/docs/doc/Doing/LogAdapter.html +1 -1
- data/docs/doc/Doing/Note.html +109 -3
- data/docs/doc/Doing/Pager.html +1 -1
- data/docs/doc/Doing/Plugins.html +1 -1
- data/docs/doc/Doing/Prompt.html +1 -1
- data/docs/doc/Doing/Section.html +1 -1
- data/docs/doc/Doing/TemplateString.html +1 -1
- data/docs/doc/Doing/Types.html +1 -1
- data/docs/doc/Doing/Util/Backup.html +1 -1
- data/docs/doc/Doing/Util.html +1 -1
- data/docs/doc/Doing/WWID.html +6 -6
- data/docs/doc/Doing.html +2 -2
- data/docs/doc/FalseClass.html +1 -1
- data/docs/doc/GLI/Commands/Help.html +1 -1
- 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/Object.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 +1 -1
- data/docs/doc/Symbol.html +1 -1
- data/docs/doc/Time.html +1 -1
- data/docs/doc/TrueClass.html +1 -1
- data/docs/doc/_index.html +3 -1
- data/docs/doc/file.README.html +2 -2
- data/docs/doc/index.html +2 -2
- data/docs/doc/method_list.html +337 -241
- data/docs/doc/top-level-namespace.html +105 -1
- data/docs/index.md +1 -1
- data/doing.gemspec +24 -23
- data/doing.rdoc +43 -41
- data/example_plugin.rb +7 -5
- data/inputrc +57 -0
- data/lib/completion/_doing.zsh +4 -8
- data/lib/completion/doing.fish +4 -8
- data/lib/doing/add_options.rb +117 -0
- data/lib/doing/array/array.rb +16 -0
- data/lib/doing/changelog/changes.rb +23 -6
- data/lib/doing/changelog/version.rb +11 -3
- data/lib/doing/completion/bash_completion.rb +12 -51
- data/lib/doing/completion/fish_completion.rb +16 -52
- data/lib/doing/completion/zsh_completion.rb +12 -51
- data/lib/doing/completion.rb +203 -17
- data/lib/doing/configuration.rb +12 -6
- data/lib/doing/item.rb +21 -3
- data/lib/doing/items.rb +5 -5
- data/lib/doing/note.rb +24 -8
- data/lib/doing/plugins/export/dayone_export.rb +8 -6
- data/lib/doing/plugins/export/html_export.rb +4 -4
- data/lib/doing/plugins/export/json_export.rb +19 -20
- data/lib/doing/plugins/export/markdown_export.rb +2 -2
- data/lib/doing/plugins/export/template_export.rb +4 -4
- data/lib/doing/plugins/import/calendar_import.rb +1 -1
- data/lib/doing/plugins/import/doing_import.rb +1 -1
- data/lib/doing/plugins/import/timing_import.rb +1 -1
- data/lib/doing/section.rb +1 -1
- data/lib/doing/string/highlight.rb +3 -4
- data/lib/doing/string/string.rb +8 -0
- data/lib/doing/util.rb +1 -1
- data/lib/doing/util_backup.rb +12 -12
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +75 -76
- data/lib/doing.rb +58 -0
- data/lib/examples/commands/wiki.rb +27 -19
- data/lib/helpers/threaded_tests.rb +2 -0
- data/scripts/setting_replace.rb +11 -0
- metadata +107 -103
- data/.yardoc/checksums +0 -29
- data/.yardoc/complete +0 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/lib/completion/doing.bash +0 -504
@@ -97,12 +97,116 @@
|
|
97
97
|
|
98
98
|
|
99
99
|
|
100
|
+
|
101
|
+
<h2>
|
102
|
+
Instance Method Summary
|
103
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
104
|
+
</h2>
|
105
|
+
|
106
|
+
<ul class="summary">
|
107
|
+
|
108
|
+
<li class="public ">
|
109
|
+
<span class="summary_signature">
|
110
|
+
|
111
|
+
<a href="top-level-namespace.html#add_options-instance_method" title="#add_options (instance method)">#<strong>add_options</strong>(type, cmd) ⇒ Object </a>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
</span>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<span class="summary_desc"><div class='inline'><p>Add presets of flags and switches to a command.</p>
|
126
|
+
</div></span>
|
127
|
+
|
128
|
+
</li>
|
100
129
|
|
130
|
+
|
131
|
+
</ul>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<div id="instance_method_details" class="method_details_list">
|
137
|
+
<h2>Instance Method Details</h2>
|
138
|
+
|
139
|
+
|
140
|
+
<div class="method_details first">
|
141
|
+
<h3 class="signature first" id="add_options-instance_method">
|
142
|
+
|
143
|
+
#<strong>add_options</strong>(type, cmd) ⇒ <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
</h3><div class="docstring">
|
150
|
+
<div class="discussion">
|
151
|
+
<p>Add presets of flags and switches to a command.</p>
|
152
|
+
|
153
|
+
<p>:add_entry => --noauto, --note, --ask, --editor, --back</p>
|
154
|
+
|
155
|
+
<p>:search => --search, --case, --exact</p>
|
156
|
+
|
157
|
+
<p>:tag_filter => --tag, --bool, --not, --val</p>
|
158
|
+
|
159
|
+
<p>:date_filter => --before, --after, --from</p>
|
160
|
+
|
161
|
+
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
<div class="tags">
|
165
|
+
<p class="tag_title">Parameters:</p>
|
166
|
+
<ul class="param">
|
167
|
+
|
168
|
+
<li>
|
169
|
+
|
170
|
+
<span class='name'>type</span>
|
171
|
+
|
172
|
+
|
173
|
+
<span class='type'>(<tt><span class='object_link'><a href="Symbol.html" title="Symbol (class)">Symbol</a></span></tt>)</span>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
—
|
178
|
+
<div class='inline'><p>The type</p>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
</li>
|
182
|
+
|
183
|
+
<li>
|
184
|
+
|
185
|
+
<span class='name'>cmd</span>
|
186
|
+
|
187
|
+
|
188
|
+
<span class='type'></span>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
—
|
193
|
+
<div class='inline'><p>The GLI command to which the options will be added</p>
|
194
|
+
</div>
|
195
|
+
|
196
|
+
</li>
|
197
|
+
|
198
|
+
</ul>
|
199
|
+
|
200
|
+
|
201
|
+
</div>
|
202
|
+
</div>
|
203
|
+
|
204
|
+
</div>
|
101
205
|
|
102
206
|
</div>
|
103
207
|
|
104
208
|
<div id="footer">
|
105
|
-
Generated on
|
209
|
+
Generated on Fri Feb 18 09:59:23 2022 by
|
106
210
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
107
211
|
0.9.27 (ruby-3.0.1).
|
108
212
|
</div>
|
data/docs/index.md
CHANGED
data/doing.gemspec
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Ensure we require the local version and not one we might have installed already
|
2
|
-
require File.join([File.dirname(__FILE__),'lib','doing','version.rb'])
|
2
|
+
require File.join([File.dirname(__FILE__), 'lib', 'doing', 'version.rb'])
|
3
3
|
spec = Gem::Specification.new do |s|
|
4
4
|
s.name = 'doing'
|
5
5
|
s.version = Doing::VERSION
|
@@ -8,13 +8,14 @@ spec = Gem::Specification.new do |s|
|
|
8
8
|
s.homepage = 'http://brettterpstra.com/project/doing/'
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
s.summary = 'A command line tool for managing What Was I Doing reminders'
|
11
|
-
s.description =
|
11
|
+
s.description = [
|
12
|
+
'A tool for managing a TaskPaper-like file of recent activites.',
|
13
|
+
'Perfect for the late-night hacker on too much caffeine to remember',
|
14
|
+
'what they accomplished at 2 in the morning.'
|
15
|
+
].join(' ')
|
12
16
|
s.license = 'MIT'
|
13
|
-
# Add your other files here if you make them
|
14
17
|
s.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
15
|
-
|
16
|
-
f.strip =~ /^((test|spec|features)\/|\.git|buildnotes)/
|
17
|
-
}
|
18
|
+
`git ls-files -z`.split("\x0").reject { |f| f.strip =~ %r{^((test|spec|features)/|\.git|buildnotes)} }
|
18
19
|
end
|
19
20
|
s.require_paths << 'lib'
|
20
21
|
|
@@ -22,27 +23,27 @@ spec = Gem::Specification.new do |s|
|
|
22
23
|
s.rdoc_options << '--title' << 'doing' << '--main' << 'README.md' << '--markup' << 'markdown'
|
23
24
|
s.bindir = 'bin'
|
24
25
|
s.executables << 'doing'
|
25
|
-
s.
|
26
|
-
s.add_development_dependency
|
27
|
-
s.add_development_dependency
|
28
|
-
s.add_development_dependency
|
29
|
-
s.add_development_dependency
|
30
|
-
s.add_development_dependency
|
31
|
-
s.add_development_dependency
|
32
|
-
s.add_development_dependency
|
33
|
-
s.
|
34
|
-
s.add_development_dependency 'tty-spinner', '~> 0.9', '>= 0.9.3'
|
35
|
-
s.add_runtime_dependency('tty-progressbar', '~> 0.18', '>= 0.18.2')
|
36
|
-
s.add_runtime_dependency('gli', '~> 2.20', '>= 2.20.1')
|
37
|
-
s.add_runtime_dependency('haml','~>5.0.0', '>= 5.0.0')
|
38
|
-
s.add_runtime_dependency('chronic','~> 0.10', '>= 0.10.2')
|
26
|
+
s.add_development_dependency('github-markup', '~> 4.0', '>= 4.0.0')
|
27
|
+
s.add_development_dependency('parallel_tests', '~> 3.7', '>= 3.7.3')
|
28
|
+
s.add_development_dependency('rake', '~> 13.0', '>= 13.0.1')
|
29
|
+
s.add_development_dependency('rdoc', '~> 6.3.1')
|
30
|
+
s.add_development_dependency('redcarpet', '~> 3.5', '>= 3.5.1')
|
31
|
+
s.add_development_dependency('test-unit', '~> 3.4.4')
|
32
|
+
s.add_development_dependency('tty-spinner', '~> 0.9', '>= 0.9.3')
|
33
|
+
s.add_development_dependency('yard', '~> 0.9', '>= 0.9.26')
|
34
|
+
s.add_runtime_dependency('chronic', '~> 0.10', '>= 0.10.2')
|
39
35
|
s.add_runtime_dependency('deep_merge', '~> 1.2', '>= 1.2.1')
|
36
|
+
s.add_runtime_dependency('gli', '~> 2.20', '>= 2.20.1')
|
37
|
+
s.add_runtime_dependency('haml', '~>5.0.0', '>= 5.0.0')
|
38
|
+
s.add_runtime_dependency('parslet', '~> 2.0', '>= 2.0.0')
|
39
|
+
s.add_runtime_dependency('plist', '~> 3.6', '>= 3.6.0')
|
40
|
+
s.add_runtime_dependency('safe_yaml', '~> 1.0')
|
41
|
+
s.add_runtime_dependency('sys-uname', '~> 1.2', '>= 1.2.2')
|
40
42
|
s.add_runtime_dependency('tty-link', '~> 0.1', '>= 0.1.1')
|
41
|
-
s.add_runtime_dependency('tty-which', '~> 0.5', '>= 0.5.0')
|
42
43
|
s.add_runtime_dependency('tty-markdown', '~> 0.7', '>= 0.7.0')
|
44
|
+
s.add_runtime_dependency('tty-progressbar', '~> 0.18', '>= 0.18.2')
|
43
45
|
s.add_runtime_dependency('tty-reader', '~> 0.9', '>= 0.9.0')
|
44
46
|
s.add_runtime_dependency('tty-screen', '~> 0.8', '>= 0.8.1')
|
45
|
-
s.add_runtime_dependency('
|
46
|
-
s.add_runtime_dependency('plist', '~> 3.6', '>= 3.6.0')
|
47
|
+
s.add_runtime_dependency('tty-which', '~> 0.5', '>= 0.5.0')
|
47
48
|
# s.add_runtime_dependency('amatch', '~> 0.4', '>= 0.4.0')
|
48
49
|
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.32
|
9
9
|
|
10
10
|
=== Global Options
|
11
11
|
=== --config_file arg
|
@@ -440,10 +440,10 @@ Display a formatted list of changes in recent versions.
|
|
440
440
|
|
441
441
|
Look up a specific version. Specify versions as "MAJ.MIN.PATCH", MIN
|
442
442
|
and PATCH are optional. Use > or < to see all changes since or prior
|
443
|
-
to a version.
|
443
|
+
to a version. Wildcards (*?) accepted unless using < or >.
|
444
444
|
|
445
445
|
[Default Value] None
|
446
|
-
[Must Match] (?-mix:^(?:(?:(?:[<>=]
|
446
|
+
[Must Match] (?-mix:^(?:(?:(?:[<>=]+|p(?:rior)|b(?:efore)|o(?:lder)|s(?:ince)|a(?:fter)|n(?:ewer))? *[0-9.*?]+ *)+|(?:[\d.]+ *(?:-|to)+ *[0-9.]+))$)
|
447
447
|
|
448
448
|
|
449
449
|
===== -s|--search arg
|
@@ -472,11 +472,21 @@ Display all versions
|
|
472
472
|
|
473
473
|
|
474
474
|
|
475
|
+
===== -i|--interactive
|
476
|
+
Open changelog in interactive viewer
|
477
|
+
|
478
|
+
|
479
|
+
|
475
480
|
===== -m|--md|--markdown
|
476
481
|
Output raw Markdown
|
477
482
|
|
478
483
|
|
479
484
|
|
485
|
+
===== --render
|
486
|
+
Force rendered output
|
487
|
+
|
488
|
+
|
489
|
+
|
480
490
|
==== Command: <tt>colors </tt>
|
481
491
|
List available color variables for configuration templates and views
|
482
492
|
|
@@ -496,26 +506,42 @@ Disable Doing commands
|
|
496
506
|
|
497
507
|
[Default Command] add
|
498
508
|
==== Command: <tt>completion </tt>
|
499
|
-
Generate shell completion scripts
|
509
|
+
Generate shell completion scripts for doing
|
500
510
|
|
501
511
|
Generates the necessary scripts to add command line completion to various shells,
|
502
512
|
so typing 'doing' and hitting tab will offer completions of subcommands and their options.
|
503
513
|
===== Options
|
504
|
-
===== -
|
514
|
+
===== -t|--type arg
|
505
515
|
|
506
|
-
|
516
|
+
Deprecated, specify shell as argument to subcommand
|
507
517
|
|
508
|
-
[Default Value]
|
518
|
+
[Default Value] None
|
519
|
+
[Must Match] (?i-mx:^(?:[bzf](?:[ai]?sh)?|all)$)
|
509
520
|
|
510
521
|
|
511
|
-
=====
|
522
|
+
===== Commands
|
523
|
+
====== Command: <tt>generate [zsh|bash|fish|all]</tt>
|
524
|
+
Generate completion scripts, including custom plugins and command options
|
525
|
+
|
526
|
+
Argument specifies which shell to install for: zsh, bash, fish, all
|
527
|
+
======= Options
|
528
|
+
======= -f|--file PATH
|
529
|
+
|
530
|
+
Alternative file to write output to
|
531
|
+
|
532
|
+
[Default Value] None
|
533
|
+
Argument specifies which shell to install for: zsh, bash, fish, all
|
534
|
+
|
535
|
+
======= --stdout
|
536
|
+
Output result to STDOUT only
|
512
537
|
|
513
|
-
Shell to generate for (bash, zsh, fish)
|
514
538
|
|
515
|
-
[Default Value] zsh
|
516
|
-
[Must Match] (?i-mx:^(?:[bzf](?:[ai]?sh)?|all)$)
|
517
539
|
|
540
|
+
====== Command: <tt>install [zsh|bash|fish]</tt>
|
541
|
+
Install default completion scripts
|
518
542
|
|
543
|
+
Argument specifies which shell to install for: zsh, bash, fish, or all
|
544
|
+
[Default Command] generate
|
519
545
|
==== Command: <tt>config </tt>
|
520
546
|
Edit the configuration file or output a value from it
|
521
547
|
|
@@ -594,6 +620,11 @@ Set a key's value in the config file
|
|
594
620
|
|
595
621
|
|
596
622
|
======= Options
|
623
|
+
======= --local
|
624
|
+
Force update to .doingrc in the current directory
|
625
|
+
|
626
|
+
|
627
|
+
|
597
628
|
======= -r|--remove
|
598
629
|
Delete specified key
|
599
630
|
|
@@ -1169,35 +1200,6 @@ Force exact search string matching (case sensitive)
|
|
1169
1200
|
|
1170
1201
|
|
1171
1202
|
|
1172
|
-
==== Command: <tt>later ENTRY</tt>
|
1173
|
-
Add an item to the Later section
|
1174
|
-
|
1175
|
-
|
1176
|
-
===== Options
|
1177
|
-
===== -b|--back|--started DATE_STRING
|
1178
|
-
|
1179
|
-
Backdate start time to date string [4pm|20m|2h|yesterday noon]
|
1180
|
-
|
1181
|
-
[Default Value] None
|
1182
|
-
|
1183
|
-
|
1184
|
-
===== -n|--note TEXT
|
1185
|
-
|
1186
|
-
Note
|
1187
|
-
|
1188
|
-
[Default Value] None
|
1189
|
-
|
1190
|
-
|
1191
|
-
===== --ask
|
1192
|
-
Prompt for note via multi-line input
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
===== -e|--editor
|
1197
|
-
Edit entry with vim
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
1203
|
==== Command: <tt>mark|flag </tt>
|
1202
1204
|
Mark last entry as flagged
|
1203
1205
|
|
@@ -1549,7 +1551,7 @@ Show time totals at the end of output
|
|
1549
1551
|
==== Command: <tt>open </tt>
|
1550
1552
|
Open the "doing" file in an editor
|
1551
1553
|
|
1552
|
-
`doing open` defaults to using the editors
|
1554
|
+
`doing open` defaults to using the editors.doing_file setting
|
1553
1555
|
in /Users/ttscoff/.config/doing/config.yml (TaskPaper).
|
1554
1556
|
===== Options
|
1555
1557
|
===== -a|--app APP_NAME
|
data/example_plugin.rb
CHANGED
@@ -54,7 +54,7 @@ module Doing
|
|
54
54
|
## automatically be added for the user to override
|
55
55
|
## The config key will be available at:
|
56
56
|
##
|
57
|
-
##
|
57
|
+
## Doing.config.settings['export_templates'][PLUGIN_NAME]
|
58
58
|
##
|
59
59
|
## config: (optional) A Hash which will be
|
60
60
|
## added to the main configuration in the plugins section.
|
@@ -65,7 +65,7 @@ module Doing
|
|
65
65
|
##
|
66
66
|
## The configuration keys will be available at:
|
67
67
|
##
|
68
|
-
##
|
68
|
+
## Doing.config.settings['plugins'][PLUGIN_NAME][KEY]
|
69
69
|
##
|
70
70
|
## Method to return plugin settings (required)
|
71
71
|
##
|
@@ -125,6 +125,8 @@ module Doing
|
|
125
125
|
def self.render(wwid, items, variables: {})
|
126
126
|
return unless items.good?
|
127
127
|
|
128
|
+
config = Doing.config.settings
|
129
|
+
|
128
130
|
# the :options key includes the flags passed to the
|
129
131
|
# command that called the plugin use `puts
|
130
132
|
# variables.inspect` to see properties and methods
|
@@ -162,8 +164,8 @@ module Doing
|
|
162
164
|
title = i.title.gsub(/@/, 'hashtag ')
|
163
165
|
tpl = template('say')
|
164
166
|
|
165
|
-
if
|
166
|
-
cfg_tpl =
|
167
|
+
if config['export_templates'].key?('say')
|
168
|
+
cfg_tpl = config['export_templates']['say']
|
167
169
|
tpl = cfg_tpl if cfg_tpl.good?
|
168
170
|
end
|
169
171
|
output = tpl.dup
|
@@ -188,7 +190,7 @@ module Doing
|
|
188
190
|
Doing.logger.info('Spoke the last entry. Did you hear it?')
|
189
191
|
|
190
192
|
# This export runs a command for fun, most plugins won't
|
191
|
-
voice =
|
193
|
+
voice = config['plugins']['say']['say_voice'] || 'Alex'
|
192
194
|
`say -v "#{voice}" "#{output}"`
|
193
195
|
|
194
196
|
# Return the result (don't output to terminal with puts or print)
|
data/inputrc
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
"\e[3~": delete-char
|
2
|
+
"\ex": 'cd !$ \015ls\015'
|
3
|
+
"\ez": 'cd -\015'
|
4
|
+
"\e\C-m": '\C-a "$(\C-e|fzf)"\C-a'
|
5
|
+
"\e/": '"$(!!|fzf)"\C-a \C-m\C-m'
|
6
|
+
# these allow you to use alt+left/right arrow keys
|
7
|
+
# to jump the cursor over words
|
8
|
+
"\e[1;5C": forward-word
|
9
|
+
"\e[1;5D": backward-word
|
10
|
+
# "\e[D": backward-word
|
11
|
+
# "\e[C": forward-word
|
12
|
+
"\ea": menu-complete
|
13
|
+
# TAB: menu-complete
|
14
|
+
# "\e[Z": "\e-1\C-i"
|
15
|
+
|
16
|
+
"\e\C-l": history-and-alias-expand-line
|
17
|
+
|
18
|
+
# these allow you to start typing a command and
|
19
|
+
# use the up/down arrow to auto complete from
|
20
|
+
# commands in your history
|
21
|
+
"\e[B": history-search-forward
|
22
|
+
"\e[A": history-search-backward
|
23
|
+
"\ew": history-search-backward
|
24
|
+
"\es": history-search-forward
|
25
|
+
# this lets you hit tab to auto-complete a file or
|
26
|
+
# directory name ignoring case
|
27
|
+
set completion-ignore-case On
|
28
|
+
set mark-symlinked-directories On
|
29
|
+
set completion-prefix-display-length 2
|
30
|
+
set bell-style none
|
31
|
+
# set bell-style visible
|
32
|
+
set meta-flag on
|
33
|
+
set convert-meta off
|
34
|
+
set input-meta on
|
35
|
+
set output-meta on
|
36
|
+
set show-all-if-ambiguous on
|
37
|
+
set show-all-if-unmodified on
|
38
|
+
set completion-map-case on
|
39
|
+
set visible-stats on
|
40
|
+
|
41
|
+
# Do history expansion when space entered?
|
42
|
+
$if bash
|
43
|
+
Space: magic-space
|
44
|
+
$endif
|
45
|
+
|
46
|
+
# Show extra file information when completing, like `ls -F` does
|
47
|
+
set visible-stats on
|
48
|
+
|
49
|
+
# Be more intelligent when autocompleting by also looking at the text after
|
50
|
+
# the cursor. For example, when the current line is "cd ~/src/mozil", and
|
51
|
+
# the cursor is on the "z", pressing Tab will not autocomplete it to "cd
|
52
|
+
# ~/src/mozillail", but to "cd ~/src/mozilla". (This is supported by the
|
53
|
+
# Readline used by Bash 4.)
|
54
|
+
set skip-completed-text on
|
55
|
+
|
56
|
+
# Use Alt/Meta + Delete to delete the preceding word
|
57
|
+
"\e[3;3~": kill-word
|
data/lib/completion/_doing.zsh
CHANGED
@@ -18,7 +18,7 @@ function _doing() {
|
|
18
18
|
'changelog:List recent changes in Doing'
|
19
19
|
'colors:List available color variables for configuration templates and views'
|
20
20
|
'commands:Enable and disable Doing commands'
|
21
|
-
'completion:Generate shell completion scripts'
|
21
|
+
'completion:Generate shell completion scripts for doing'
|
22
22
|
'config:Edit the configuration file or output a value from it'
|
23
23
|
'done:Add a completed item with @done(date)'
|
24
24
|
'did:Add a completed item with @done(date)'
|
@@ -28,7 +28,6 @@ function _doing() {
|
|
28
28
|
'help:Shows a list of commands or help for one command'
|
29
29
|
'import:Import entries from an external source'
|
30
30
|
'last:Show the last entry'
|
31
|
-
'later:Add an item to the Later section'
|
32
31
|
'mark:Mark last entry as flagged'
|
33
32
|
'flag:Mark last entry as flagged'
|
34
33
|
'meanwhile:Finish any running @meanwhile tasks and optionally create a new one'
|
@@ -89,10 +88,10 @@ function _doing() {
|
|
89
88
|
args=( {-a,--archive}"[Archive entries]" "(--bool=)--bool=}[Boolean used to combine multiple tags]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" {-i,--interactive}"[Select item(s) to cancel from a menu of matching entries]" "(--not)--not}[Cancel items that *dont* match search/tag filterst* match search/tag filters]" {-s,--section=}"[Section]" "(--search=)--search=}[Filter entries using a search query]" "(--tag=)--tag=}[Filter entries by tag]" {-u,--unfinished}"[Cancel last entry]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact search string matching]" )
|
90
89
|
;;
|
91
90
|
changes)
|
92
|
-
args=( {-C,--changes}"[Only output changes]" {-a,--all}"[Display all versions]" {-l,--lookup=}"[Look up a specific version]" "(--markdown)--markdown}[Output raw Markdown]" {-s,--search=}"[Show changelogs matching search terms]" "(--sort=)--sort=}[Sort order]" )
|
91
|
+
args=( {-C,--changes}"[Only output changes]" {-a,--all}"[Display all versions]" {-i,--interactive}"[Open changelog in interactive viewer]" {-l,--lookup=}"[Look up a specific version]" "(--markdown)--markdown}[Output raw Markdown]" "(--render)--render}[Force rendered output]" {-s,--search=}"[Show changelogs matching search terms]" "(--sort=)--sort=}[Sort order]" )
|
93
92
|
;;
|
94
93
|
changelog)
|
95
|
-
args=( {-C,--changes}"[Only output changes]" {-a,--all}"[Display all versions]" {-l,--lookup=}"[Look up a specific version]" "(--markdown)--markdown}[Output raw Markdown]" {-s,--search=}"[Show changelogs matching search terms]" "(--sort=)--sort=}[Sort order]" )
|
94
|
+
args=( {-C,--changes}"[Only output changes]" {-a,--all}"[Display all versions]" {-i,--interactive}"[Open changelog in interactive viewer]" {-l,--lookup=}"[Look up a specific version]" "(--markdown)--markdown}[Output raw Markdown]" "(--render)--render}[Force rendered output]" {-s,--search=}"[Show changelogs matching search terms]" "(--sort=)--sort=}[Sort order]" )
|
96
95
|
;;
|
97
96
|
colors)
|
98
97
|
args=( )
|
@@ -101,7 +100,7 @@ function _doing() {
|
|
101
100
|
args=( )
|
102
101
|
;;
|
103
102
|
completion)
|
104
|
-
args=( {-
|
103
|
+
args=( {-t,--type=}"[Deprecated]" )
|
105
104
|
;;
|
106
105
|
config)
|
107
106
|
args=( {-d,--dump}"[DEPRECATED]" {-u,--update}"[DEPRECATED]" )
|
@@ -130,9 +129,6 @@ function _doing() {
|
|
130
129
|
last)
|
131
130
|
args=( "(--bool=)--bool=}[Boolean used to combine multiple tags]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" "(--config_template=)--config_template=}[Output using a template from configuration]" {-d,--delete}"[Delete the last entry]" "(--duration)--duration}[Show elapsed time if entry is not tagged @done]" {-e,--editor}"[Edit entry with vim]" {-h,--hilite}"[Highlight search matches in output]" "(--not)--not}[Show items that *dont* match search/tag filterst* match search/tag filters]" {-s,--section=}"[Specify a section]" "(--search=)--search=}[Filter entries using a search query]" "(--tag=)--tag=}[Filter entries by tag]" "(--template=)--template=}[Override output format with a template string containing %placeholders]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact search string matching]" )
|
132
131
|
;;
|
133
|
-
later)
|
134
|
-
args=( "(--ask)--ask}[Prompt for note via multi-line input]" "(--started=)--started=}[Backdate start time to date string [4pm|20m|2h|yesterday noon]]" {-e,--editor}"[Edit entry with vim]" {-n,--note=}"[Note]" )
|
135
|
-
;;
|
136
132
|
mark)
|
137
133
|
args=( "(--bool=)--bool=}[Boolean used to combine multiple tags]" {-c,--count=}"[How many recent entries to tag]" "(--case=)--case=}[Case sensitivity for search string matching [(c)ase-sensitive]" {-d,--date}"[Include current date/time with tag]" "(--force)--force}[Dont ask permission to flag all entries when count is 0t ask permission to flag all entries when count is 0]" {-i,--interactive}"[Select item(s) to flag from a menu of matching entries]" "(--not)--not}[Flag items that *dont* match search/tag filterst* match search/tag filters]" {-r,--remove}"[Remove flag]" {-s,--section=}"[Section]" "(--search=)--search=}[Filter entries using a search query]" "(--tag=)--tag=}[Filter entries by tag]" {-u,--unfinished}"[Flag last entry]" "(--val=)--val=}[Perform a tag value query]" {-x,--exact}"[Force exact search string matching]" )
|
138
134
|
;;
|
data/lib/completion/doing.fish
CHANGED
@@ -143,7 +143,7 @@ complete -xc doing -n '__fish_doing_needs_command' -a 'cancel' -d End\ last\ X\
|
|
143
143
|
complete -xc doing -n '__fish_doing_needs_command' -a 'changes changelog' -d List\ recent\ changes\ in\ Doing
|
144
144
|
complete -xc doing -n '__fish_doing_needs_command' -a 'colors' -d List\ available\ color\ variables\ for\ configuration\ templates\ and\ views
|
145
145
|
complete -xc doing -n '__fish_doing_needs_command' -a 'commands' -d Enable\ and\ disable\ Doing\ commands
|
146
|
-
complete -xc doing -n '__fish_doing_needs_command' -a 'completion' -d Generate\ shell\ completion\ scripts
|
146
|
+
complete -xc doing -n '__fish_doing_needs_command' -a 'completion' -d Generate\ shell\ completion\ scripts\ for\ doing
|
147
147
|
complete -xc doing -n '__fish_doing_needs_command' -a 'config' -d Edit\ the\ configuration\ file\ or\ output\ a\ value\ from\ it
|
148
148
|
complete -xc doing -n '__fish_doing_needs_command' -a 'done did' -d Add\ a\ completed\ item\ with\ @done\(date\)
|
149
149
|
complete -xc doing -n '__fish_doing_needs_command' -a 'finish' -d Mark\ last\ X\ entries\ as\ @done
|
@@ -151,7 +151,6 @@ complete -xc doing -n '__fish_doing_needs_command' -a 'grep search' -d Search\ f
|
|
151
151
|
complete -xc doing -n '__fish_doing_needs_command' -a 'help' -d Shows\ a\ list\ of\ commands\ or\ help\ for\ one\ command
|
152
152
|
complete -xc doing -n '__fish_doing_needs_command' -a 'import' -d Import\ entries\ from\ an\ external\ source
|
153
153
|
complete -xc doing -n '__fish_doing_needs_command' -a 'last' -d Show\ the\ last\ entry
|
154
|
-
complete -xc doing -n '__fish_doing_needs_command' -a 'later' -d Add\ an\ item\ to\ the\ Later\ section
|
155
154
|
complete -xc doing -n '__fish_doing_needs_command' -a 'mark flag' -d Mark\ last\ entry\ as\ flagged
|
156
155
|
complete -xc doing -n '__fish_doing_needs_command' -a 'meanwhile' -d Finish\ any\ running\ @meanwhile\ tasks\ and\ optionally\ create\ a\ new\ one
|
157
156
|
complete -xc doing -n '__fish_doing_needs_command' -a 'note' -d Add\ a\ note\ to\ the\ last\ entry
|
@@ -227,12 +226,13 @@ complete -c doing -l val -f -r -n '__fish_doing_using_command cancel' -d Perfor
|
|
227
226
|
complete -c doing -l exact -s x -f -n '__fish_doing_using_command cancel' -d Force\ exact\ search\ string\ matching
|
228
227
|
complete -c doing -l changes -s C -f -n '__fish_doing_using_command changes changelog' -d Only\ output\ changes
|
229
228
|
complete -c doing -l all -s a -f -n '__fish_doing_using_command changes changelog' -d Display\ all\ versions
|
229
|
+
complete -c doing -l interactive -s i -f -n '__fish_doing_using_command changes changelog' -d Open\ changelog\ in\ interactive\ viewer
|
230
230
|
complete -c doing -l lookup -s l -f -r -n '__fish_doing_using_command changes changelog' -d Look\ up\ a\ specific\ version
|
231
231
|
complete -c doing -l markdown -f -n '__fish_doing_using_command changes changelog' -d Output\ raw\ Markdown
|
232
|
+
complete -c doing -l render -f -n '__fish_doing_using_command changes changelog' -d Force\ rendered\ output
|
232
233
|
complete -c doing -l search -s s -f -r -n '__fish_doing_using_command changes changelog' -d Show\ changelogs\ matching\ search\ terms
|
233
234
|
complete -c doing -l sort -f -r -n '__fish_doing_using_command changes changelog' -d Sort\ order
|
234
|
-
complete -c doing -l
|
235
|
-
complete -c doing -l type -s t -f -r -n '__fish_doing_using_command completion' -d Shell\ to\ generate\ for
|
235
|
+
complete -c doing -l type -s t -f -r -n '__fish_doing_using_command completion' -d Deprecated
|
236
236
|
complete -c doing -l dump -s d -f -n '__fish_doing_using_command config' -d DEPRECATED
|
237
237
|
complete -c doing -l update -s u -f -n '__fish_doing_using_command config' -d DEPRECATED
|
238
238
|
complete -c doing -l noauto -s X -f -n '__fish_doing_using_command done did' -d Exclude\ auto\ tags\ and\ default\ tags
|
@@ -316,10 +316,6 @@ complete -c doing -l tag -f -r -n '__fish_doing_using_command last' -d Filter\
|
|
316
316
|
complete -c doing -l template -f -r -n '__fish_doing_using_command last' -d Override\ output\ format\ with\ a\ template\ string\ containing\ \%placeholders
|
317
317
|
complete -c doing -l val -f -r -n '__fish_doing_using_command last' -d Perform\ a\ tag\ value\ query
|
318
318
|
complete -c doing -l exact -s x -f -n '__fish_doing_using_command last' -d Force\ exact\ search\ string\ matching
|
319
|
-
complete -c doing -l ask -f -n '__fish_doing_using_command later' -d Prompt\ for\ note\ via\ multi-line\ input
|
320
|
-
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\]
|
321
|
-
complete -c doing -l editor -s e -f -n '__fish_doing_using_command later' -d Edit\ entry\ with\ vim
|
322
|
-
complete -c doing -l note -s n -f -r -n '__fish_doing_using_command later' -d Note
|
323
319
|
complete -c doing -l bool -f -r -n '__fish_doing_using_command mark flag' -d Boolean\ used\ to\ combine\ multiple\ tags
|
324
320
|
complete -c doing -l count -s c -f -r -n '__fish_doing_using_command mark flag' -d How\ many\ recent\ entries\ to\ tag
|
325
321
|
complete -c doing -l case -f -r -n '__fish_doing_using_command mark flag' -d Case\ sensitivity\ for\ search\ string\ matching\ \[\(c\)ase-sensitive
|
@@ -0,0 +1,117 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
## Add presets of flags and switches to a command.
|
5
|
+
##
|
6
|
+
## :add_entry => --noauto, --note, --ask, --editor, --back
|
7
|
+
##
|
8
|
+
## :search => --search, --case, --exact
|
9
|
+
##
|
10
|
+
## :tag_filter => --tag, --bool, --not, --val
|
11
|
+
##
|
12
|
+
## :date_filter => --before, --after, --from
|
13
|
+
##
|
14
|
+
## @param type [Symbol] The type
|
15
|
+
## @param cmd The GLI command to which the options will be added
|
16
|
+
##
|
17
|
+
def add_options(type, cmd)
|
18
|
+
cmd_name = cmd.name.to_s
|
19
|
+
action = case cmd_name
|
20
|
+
when /again/
|
21
|
+
'Repeat'
|
22
|
+
when /grep/
|
23
|
+
'Search'
|
24
|
+
when /mark/
|
25
|
+
'Flag'
|
26
|
+
when /(last|tags|view)/
|
27
|
+
'Show'
|
28
|
+
else
|
29
|
+
cmd_name.capitalize
|
30
|
+
end
|
31
|
+
|
32
|
+
case type
|
33
|
+
when :add_entry
|
34
|
+
cmd.desc 'Exclude auto tags and default tags'
|
35
|
+
cmd.switch %i[X noauto], default_value: false, negatable: false
|
36
|
+
|
37
|
+
cmd.desc 'Include a note'
|
38
|
+
cmd.arg_name 'TEXT'
|
39
|
+
cmd.flag %i[n note]
|
40
|
+
|
41
|
+
cmd.desc 'Prompt for note via multi-line input'
|
42
|
+
cmd.switch %i[ask], negatable: false, default_value: false
|
43
|
+
|
44
|
+
cmd.desc "Edit entry with #{Doing::Util.default_editor}"
|
45
|
+
cmd.switch %i[e editor], negatable: false, default_value: false
|
46
|
+
|
47
|
+
cmd.desc 'Backdate start date for new entry to date string [4pm|20m|2h|yesterday noon]'
|
48
|
+
cmd.arg_name 'DATE_STRING'
|
49
|
+
cmd.flag %i[b back started], type: DateBeginString
|
50
|
+
when :search
|
51
|
+
cmd.desc 'Filter entries using a search query, surround with slashes for regex (e.g. "/query.*/"),
|
52
|
+
start with single quote for exact match ("\'query")'
|
53
|
+
cmd.arg_name 'QUERY'
|
54
|
+
cmd.flag [:search]
|
55
|
+
|
56
|
+
cmd.desc 'Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]'
|
57
|
+
cmd.arg_name 'TYPE'
|
58
|
+
cmd.flag [:case], must_match: REGEX_CASE,
|
59
|
+
default_value: Doing.settings.dig('search', 'case').normalize_case,
|
60
|
+
type: CaseSymbol
|
61
|
+
|
62
|
+
cmd.desc 'Force exact search string matching (case sensitive)'
|
63
|
+
cmd.switch %i[x exact], default_value: Doing.config.exact_match?, negatable: Doing.config.exact_match?
|
64
|
+
when :tag_filter
|
65
|
+
cmd.desc 'Filter entries by tag. Combine multiple tags with a comma. Wildcards allowed (*, ?)'
|
66
|
+
cmd.arg_name 'TAG'
|
67
|
+
cmd.flag [:tag], type: TagArray
|
68
|
+
|
69
|
+
cmd.desc 'Perform a tag value query ("@done > two hours ago" or "@progress < 50").
|
70
|
+
May be used multiple times, combined with --bool'
|
71
|
+
cmd.arg_name 'QUERY'
|
72
|
+
cmd.flag [:val], multiple: true, must_match: REGEX_VALUE_QUERY
|
73
|
+
|
74
|
+
cmd.desc "#{action} items that *don't* match search/tag filters"
|
75
|
+
cmd.switch [:not], default_value: false, negatable: false
|
76
|
+
|
77
|
+
cmd.desc 'Boolean used to combine multiple tags. Use PATTERN to parse + and - as booleans'
|
78
|
+
cmd.arg_name 'BOOLEAN'
|
79
|
+
cmd.flag [:bool], must_match: REGEX_BOOL,
|
80
|
+
default_value: :pattern,
|
81
|
+
type: BooleanSymbol
|
82
|
+
when :date_filter
|
83
|
+
if action =~ /Archive/
|
84
|
+
cmd.desc 'Archive entries older than date (natural language).'
|
85
|
+
else
|
86
|
+
cmd.desc "#{action} entries older than date (natural language). If this is only a time (8am, 1:30pm, 15:00), all
|
87
|
+
dates will be included, but entries will be filtered by time of day"
|
88
|
+
end
|
89
|
+
cmd.arg_name 'DATE_STRING'
|
90
|
+
cmd.flag [:before], type: DateBeginString
|
91
|
+
|
92
|
+
if action =~ /Archive/
|
93
|
+
cmd.desc 'Archive entries newer than date (natural language).'
|
94
|
+
else
|
95
|
+
cmd.desc "#{action} entries newer than date (natural language). If this is only a time (8am, 1:30pm, 15:00), all
|
96
|
+
dates will be included, but entries will be filtered by time of day"
|
97
|
+
end
|
98
|
+
cmd.arg_name 'DATE_STRING'
|
99
|
+
cmd.flag [:after], type: DateEndString
|
100
|
+
|
101
|
+
if action =~ /Archive/
|
102
|
+
cmd.desc %(
|
103
|
+
Date range (natural language) to archive: `doing archive --from "1/1/21 to 12/31/21"`.
|
104
|
+
)
|
105
|
+
else
|
106
|
+
cmd.desc %(
|
107
|
+
Date range (natural language) to #{action.downcase}, or a single day to filter on.
|
108
|
+
To specify a range, use "to": `doing #{cmd_name} --from "monday 8am to friday 5pm"`.
|
109
|
+
|
110
|
+
If values are only time(s) (6am to noon) all dates will be included, but entries will be filtered
|
111
|
+
by time of day.
|
112
|
+
)
|
113
|
+
end
|
114
|
+
cmd.arg_name 'DATE_OR_RANGE'
|
115
|
+
cmd.flag [:from], type: DateRangeString
|
116
|
+
end
|
117
|
+
end
|