doing 2.1.26 → 2.1.27
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 +14 -19
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/CHANGELOG.md +23 -0
- data/Dockerfile +5 -5
- data/Dockerfile-2.6 +5 -5
- data/Dockerfile-2.7 +5 -4
- data/Dockerfile-3.0 +5 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/Rakefile +2 -3
- data/bin/commands/add_section.rb +2 -0
- data/bin/commands/again.rb +23 -65
- data/bin/commands/archive.rb +20 -61
- data/bin/commands/cancel.rb +27 -69
- data/bin/commands/changes.rb +32 -5
- data/bin/commands/colors.rb +4 -2
- data/bin/commands/commands.rb +4 -2
- data/bin/commands/commands_accepting.rb +62 -11
- data/bin/commands/completion.rb +10 -7
- data/bin/commands/config.rb +1 -1
- data/bin/commands/done.rb +3 -17
- data/bin/commands/finish.rb +7 -30
- data/bin/commands/flag.rb +15 -51
- data/bin/commands/grep.rb +12 -28
- data/bin/commands/import.rb +3 -33
- data/bin/commands/last.rb +3 -36
- data/bin/commands/meanwhile.rb +3 -13
- data/bin/commands/note.rb +13 -52
- data/bin/commands/now.rb +15 -21
- data/bin/commands/on.rb +3 -4
- data/bin/commands/recent.rb +3 -4
- data/bin/commands/redo.rb +6 -2
- data/bin/commands/reset.rb +19 -52
- data/bin/commands/rotate.rb +5 -36
- data/bin/commands/select.rb +23 -41
- data/bin/commands/show.rb +28 -74
- data/bin/commands/since.rb +3 -4
- data/bin/commands/tag.rb +4 -34
- data/bin/commands/tags.rb +5 -32
- data/bin/commands/today.rb +3 -4
- data/bin/commands/view.rb +36 -73
- data/bin/commands/yesterday.rb +4 -5
- data/bin/doing +150 -13
- data/docs/doc/Array.html +3 -502
- 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 +62 -56
- data/docs/doc/Doing/Completion.html +1 -1
- data/docs/doc/Doing/Configuration.html +35 -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 +2 -2
- data/docs/doc/Doing/LogAdapter.html +1 -1
- data/docs/doc/Doing/Note.html +2 -2
- data/docs/doc/Doing/Pager.html +1 -1
- data/docs/doc/Doing/Plugins.html +1 -1
- data/docs/doc/Doing/Prompt.html +1 -1
- data/docs/doc/Doing/Section.html +1 -1
- data/docs/doc/Doing/TemplateString.html +2 -2
- data/docs/doc/Doing/Types.html +41 -1
- data/docs/doc/Doing/Util/Backup.html +1 -1
- data/docs/doc/Doing/Util.html +1 -1
- data/docs/doc/Doing/WWID.html +10 -10
- data/docs/doc/Doing.html +3 -3
- data/docs/doc/FalseClass.html +35 -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 +287 -3155
- data/docs/doc/Symbol.html +40 -6
- data/docs/doc/Time.html +1 -1
- data/docs/doc/TrueClass.html +35 -1
- data/docs/doc/_index.html +5 -10
- data/docs/doc/class_list.html +1 -1
- data/docs/doc/file.README.html +2 -2
- data/docs/doc/index.html +2 -2
- data/docs/doc/method_list.html +278 -678
- data/docs/doc/top-level-namespace.html +2 -2
- data/doing.rdoc +277 -175
- data/lib/completion/_doing.zsh +33 -29
- data/lib/completion/doing.bash +30 -19
- data/lib/completion/doing.fish +84 -72
- data/lib/doing/array/array.rb +4 -0
- data/lib/doing/array/nested_hash.rb +17 -0
- data/lib/doing/{array.rb → array/tags.rb} +7 -25
- data/lib/doing/changelog/change.rb +26 -11
- data/lib/doing/changelog/changes.rb +13 -3
- data/lib/doing/{array_chronify.rb → chronify/array.rb} +0 -0
- data/lib/doing/chronify/chronify.rb +5 -0
- data/lib/doing/{numeric_chronify.rb → chronify/numeric.rb} +0 -0
- data/lib/doing/{string_chronify.rb → chronify/string.rb} +0 -0
- data/lib/doing/colors.rb +115 -54
- data/lib/doing/configuration.rb +4 -0
- data/lib/doing/good.rb +8 -0
- data/lib/doing/help_monkey_patch.rb +6 -5
- data/lib/doing/item.rb +5 -5
- data/lib/doing/items.rb +2 -2
- data/lib/doing/log_adapter.rb +35 -2
- data/lib/doing/normalize.rb +188 -0
- data/lib/doing/plugins/export/dayone_export.rb +1 -1
- data/lib/doing/plugins/export/html_export.rb +1 -1
- data/lib/doing/plugins/export/json_export.rb +1 -1
- data/lib/doing/plugins/export/markdown_export.rb +1 -1
- data/lib/doing/plugins/export/template_export.rb +3 -1
- data/lib/doing/prompt.rb +1 -3
- data/lib/doing/string/highlight.rb +95 -0
- data/lib/doing/string/query.rb +129 -0
- data/lib/doing/string/string.rb +12 -0
- data/lib/doing/string/tags.rb +164 -0
- data/lib/doing/string/transform.rb +168 -0
- data/lib/doing/string/truncate.rb +75 -0
- data/lib/doing/string/url.rb +82 -0
- data/lib/doing/template_string.rb +0 -22
- data/lib/doing/types.rb +8 -0
- data/lib/doing/util.rb +13 -9
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +53 -35
- data/lib/doing.rb +4 -6
- data/lib/examples/plugins/wiki_export/wiki_export.rb +1 -1
- data/lib/helpers/threaded_tests.rb +15 -2
- data/scripts/deploy.rb +107 -0
- data/scripts/runtests.sh +4 -0
- metadata +19 -8
- data/lib/doing/string.rb +0 -765
- data/lib/doing/symbol.rb +0 -28
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eb5059bc679e2f0eff1249b466945518f4f758ea2aed81730a0da04d8e28631e
|
|
4
|
+
data.tar.gz: d87403fa3ac7ecb8d728f8499da593316755ecee226037e8ae6f9df9d6aa7217
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd67a8a4428e4391107854a934f05b5d9521d50aa34f5be8e7f7483d23de603cb7faa2b0e6b8ad7fce2cd063c6ee06c2af00a58e954b485b6c51d11e34f0534c
|
|
7
|
+
data.tar.gz: 03dad3b0c6aa74dfb25c4b3abbff5c7feba0e4a81a897cb9166e5352494abd22359dabd59c66d654b41dd97151c4e100bca01d599c141c4820e28f4fc3c6ab50
|
data/.yardoc/checksums
CHANGED
|
@@ -1,34 +1,29 @@
|
|
|
1
|
-
lib/doing/good.rb
|
|
1
|
+
lib/doing/good.rb afeaffc5f1931b2892aa611125da461178ca1def
|
|
2
2
|
lib/doing/hash.rb 321c27f54f332260c6adced7e451016b79574d38
|
|
3
|
-
lib/doing/item.rb
|
|
3
|
+
lib/doing/item.rb b5c5cc0d1543b678ee2c4bc10d381e555e318b82
|
|
4
4
|
lib/doing/note.rb bbadd9e34e6dc43a2af1110a5107f46c39d2547f
|
|
5
5
|
lib/doing/time.rb 60183c3c31532ffea1440c766de0f90042e0fd10
|
|
6
|
-
lib/doing/util.rb
|
|
7
|
-
lib/doing/wwid.rb
|
|
8
|
-
lib/doing/array.rb b50c4604cb685dff87bc16bc20f21a5956b2b396
|
|
6
|
+
lib/doing/util.rb 3c5a795dce204584be149e9bbcf1d25f3368e901
|
|
7
|
+
lib/doing/wwid.rb f7ea82f7f5becf9b83ab36d3932250f7bd5ac758
|
|
9
8
|
lib/doing/hooks.rb 1b75ca731f9e8cb0b7a32785d6e496ee67a70d5c
|
|
10
|
-
lib/doing/items.rb
|
|
9
|
+
lib/doing/items.rb dbda21422a06828f221fe462ff159d228b942044
|
|
11
10
|
lib/doing/pager.rb 7f9d5551c8f5411c3d39b3d984ac7118f98f5da5
|
|
12
|
-
lib/doing/types.rb
|
|
13
|
-
lib/doing/colors.rb
|
|
11
|
+
lib/doing/types.rb 6263b1871efa1e8f6053d3bce69ebf678d27324e
|
|
12
|
+
lib/doing/colors.rb 8c2d1c8c7e99022d33f1548c5456a0f02d570c4f
|
|
14
13
|
lib/doing/errors.rb af07e482a5389924edc2337749c81cda501098f0
|
|
15
|
-
lib/doing/prompt.rb
|
|
16
|
-
lib/doing/string.rb 32fd00cfdfb01a664e194e70ffcad199cd217741
|
|
17
|
-
lib/doing/symbol.rb 309799458a1bc715c2707307c9a62ab26086275e
|
|
14
|
+
lib/doing/prompt.rb 330b8e6e1e85f73b54f602a0aeac58b6b422fabb
|
|
18
15
|
lib/doing/section.rb 206e119cf818f1e76798753e611180fe77bc299a
|
|
19
|
-
lib/doing/version.rb
|
|
16
|
+
lib/doing/version.rb 03aed95553bbebdccc69d107db1bec724edaa417
|
|
20
17
|
lib/doing/changelog.rb f7d1bd424e63400ab0613ef3358e614fdf53e2b5
|
|
18
|
+
lib/doing/normalize.rb b9925102db5f19cae0e524ffd1be979ab5bc1199
|
|
21
19
|
lib/doing/cli_status.rb dbedd454c4cbbd0fed9ef30120f6ec85d18b9356
|
|
22
20
|
lib/doing/completion.rb c658e7dc7898fb022a21b2bd77bedb958ca3b067
|
|
23
|
-
lib/doing/log_adapter.rb
|
|
21
|
+
lib/doing/log_adapter.rb 1bc8cab3af769a0caa0c64e8ce63c7860a628578
|
|
24
22
|
lib/doing/util_backup.rb c13f71072581b1f0d2269853611ba09273261bf9
|
|
25
|
-
lib/doing/configuration.rb
|
|
23
|
+
lib/doing/configuration.rb e47013cdc92ee5312cf0feddfb52ffac033c7f41
|
|
26
24
|
lib/doing/phrase_parser.rb 8f1789d7cf8326d8cc231b4a21505a93f8de20d2
|
|
27
|
-
lib/doing/array_chronify.rb b39b40268b1751b18acf6bae4e53885818e45f62
|
|
28
25
|
lib/doing/plugin_manager.rb cb16a82c3182ef7008359670ab96ff6b39270ccc
|
|
29
|
-
lib/doing/
|
|
30
|
-
lib/doing/
|
|
31
|
-
lib/doing/numeric_chronify.rb bedeff62a95f8a8ff116e1bf0cc1d9eb2707a900
|
|
32
|
-
lib/doing/help_monkey_patch.rb 6aa514c249e519db507ae528de2604c18cc36045
|
|
26
|
+
lib/doing/template_string.rb 5d7c7ac9bdf0d44bc32a0442b2fdd243bd1eee24
|
|
27
|
+
lib/doing/help_monkey_patch.rb bd234939e797f2578c1155985383ef4a279d4d46
|
|
33
28
|
lib/doing/boolean_term_parser.rb 075977892ac5c6e3435cb8877d8b8b68eb1962e3
|
|
34
29
|
lib/doing/markdown_document_listener.rb 45485f225068a34951ec818a345f642323e5ba35
|
data/.yardoc/object_types
CHANGED
|
Binary file
|
data/.yardoc/objects/root.dat
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
### 2.1.27
|
|
2
|
+
|
|
3
|
+
2022-02-14 06:04
|
|
4
|
+
|
|
5
|
+
#### NEW
|
|
6
|
+
|
|
7
|
+
- `doing finish --update` will overwrite any existing @done tag with a new date (current time or set with `--at` or `--back`)
|
|
8
|
+
|
|
9
|
+
#### IMPROVED
|
|
10
|
+
|
|
11
|
+
- Code refactoring and cleanup
|
|
12
|
+
- Include release dates in `doing changes` output when available
|
|
13
|
+
- Allow various naming conventions for %color strings in templates. Now `boldwhite`, `brightwhite`, `bg_bold_cyan`, and `bold_bg_cyan` all work (for example)
|
|
14
|
+
- Common flags (e.g. --search, --tag) found on multiple commands consolidated and help descriptions matched
|
|
15
|
+
- `commands_accepting` now accepts multiple arguments and a `--bool` flag
|
|
16
|
+
- `changes` command can now output changes only (no version numbers) and defaults to raw Markdown if not a TTY or the `--md` flag is used
|
|
17
|
+
- `doing archive` now accepts `--after` and `--from` date filters
|
|
18
|
+
|
|
19
|
+
#### FIXED
|
|
20
|
+
|
|
21
|
+
- Some flag descriptions in help
|
|
22
|
+
- Editor detection
|
|
23
|
+
|
|
1
24
|
### 2.1.26
|
|
2
25
|
|
|
3
26
|
2022-01-23 16:14
|
data/Dockerfile
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
FROM ruby:3.0.1
|
|
2
|
-
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
|
2
|
+
# RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
|
3
3
|
RUN mkdir /doing
|
|
4
4
|
WORKDIR /doing
|
|
5
|
-
COPY ./ /doing/
|
|
5
|
+
# COPY ./ /doing/
|
|
6
6
|
RUN gem install bundler:2.2.17
|
|
7
|
-
|
|
8
|
-
RUN
|
|
9
|
-
CMD ["
|
|
7
|
+
RUN apt-get update -y
|
|
8
|
+
RUN apt-get install -y less
|
|
9
|
+
CMD ["scripts/runtests.sh"]
|
data/Dockerfile-2.6
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
FROM ruby:2.6
|
|
2
|
+
# RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
|
2
3
|
RUN mkdir /doing
|
|
3
4
|
WORKDIR /doing
|
|
4
|
-
COPY ./ /doing/
|
|
5
|
+
# COPY ./ /doing/
|
|
5
6
|
RUN gem install bundler:2.2.17
|
|
6
|
-
|
|
7
|
-
RUN
|
|
8
|
-
|
|
9
|
-
CMD ["rake", "parallel:test"]
|
|
7
|
+
RUN apt-get update -y
|
|
8
|
+
RUN apt-get install -y less
|
|
9
|
+
CMD ["scripts/runtests.sh"]
|
data/Dockerfile-2.7
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
FROM ruby:2.7
|
|
2
|
+
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
|
2
3
|
RUN mkdir /doing
|
|
3
4
|
WORKDIR /doing
|
|
4
|
-
COPY ./ /doing/
|
|
5
|
+
# COPY ./ /doing/
|
|
5
6
|
RUN gem install bundler:2.2.17
|
|
6
|
-
|
|
7
|
-
RUN
|
|
8
|
-
CMD ["
|
|
7
|
+
RUN apt-get update -y
|
|
8
|
+
RUN apt-get install -y less
|
|
9
|
+
CMD ["scripts/runtests.sh"]
|
data/Dockerfile-3.0
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
FROM ruby:3.0.0
|
|
2
|
+
# RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
|
2
3
|
RUN mkdir /doing
|
|
3
4
|
WORKDIR /doing
|
|
4
|
-
COPY ./ /doing/
|
|
5
|
+
# COPY ./ /doing/
|
|
5
6
|
RUN gem install bundler:2.2.17
|
|
6
|
-
|
|
7
|
-
RUN
|
|
8
|
-
CMD ["
|
|
7
|
+
RUN apt-get update -y
|
|
8
|
+
RUN apt-get install -y less
|
|
9
|
+
CMD ["scripts/runtests.sh"]
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -8,7 +8,7 @@ _If you're one of the rare people like me who find this useful, feel free to
|
|
|
8
8
|
|
|
9
9
|
<!--README-->
|
|
10
10
|
|
|
11
|
-
The current version of `doing` is <!--VER-->2.1.
|
|
11
|
+
The current version of `doing` is <!--VER-->2.1.26<!--END VER-->.
|
|
12
12
|
|
|
13
13
|
Find all of the documentation in the [doing wiki][wiki].
|
|
14
14
|
|
data/Rakefile
CHANGED
|
@@ -77,15 +77,14 @@ task :dockertest, :version, :login do |_, args|
|
|
|
77
77
|
file = 'Dockerfile'
|
|
78
78
|
end
|
|
79
79
|
|
|
80
|
-
|
|
81
80
|
puts `docker build . --file #{file} -t #{img}`
|
|
82
81
|
|
|
83
|
-
exec "docker run -it #{img} /bin/bash -l" if args[:login]
|
|
82
|
+
exec "docker run -v #{File.dirname(__FILE__)}:/doing -it #{img} /bin/bash -l" if args[:login]
|
|
84
83
|
|
|
85
84
|
spinner = TTY::Spinner.new('[:spinner] Running tests ...', hide_cursor: true)
|
|
86
85
|
|
|
87
86
|
spinner.auto_spin
|
|
88
|
-
res = `docker run --rm -it #{img}`
|
|
87
|
+
res = `docker run --rm -v #{File.dirname(__FILE__)}:/doing -it #{img}`
|
|
89
88
|
# commit = puts `bash -c "docker commit $(docker ps -a|grep #{img}|awk '{print $1}'|head -n 1) #{img}"`.strip
|
|
90
89
|
spinner.success
|
|
91
90
|
spinner.stop
|
data/bin/commands/add_section.rb
CHANGED
data/bin/commands/again.rb
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# @@again @@resume
|
|
2
4
|
desc 'Repeat last entry as new entry'
|
|
3
|
-
long_desc 'This command is designed to allow multiple time intervals to be created
|
|
5
|
+
long_desc 'This command is designed to allow multiple time intervals to be created
|
|
6
|
+
for an entry by duplicating it with a new start (and end, eventually) time'
|
|
4
7
|
command %i[again resume] do |c|
|
|
5
|
-
c.example 'doing resume',
|
|
6
|
-
|
|
7
|
-
c.example 'doing
|
|
8
|
-
|
|
8
|
+
c.example 'doing resume',
|
|
9
|
+
desc: 'Duplicate the most recent entry with a new start time, removing any @done tag'
|
|
10
|
+
c.example 'doing again',
|
|
11
|
+
desc: 'again is an alias for resume'
|
|
12
|
+
c.example 'doing resume --editor',
|
|
13
|
+
desc: 'Repeat the last entry, opening the new entry in the default editor'
|
|
14
|
+
c.example 'doing resume --tag project1 --in Projects',
|
|
15
|
+
desc: 'Repeat the last entry tagged @project1, creating the new entry in the Projects section'
|
|
9
16
|
c.example 'doing resume --interactive', desc: 'Select the entry to repeat from a menu'
|
|
10
17
|
|
|
11
18
|
c.desc 'Get last entry from a specific section'
|
|
@@ -16,84 +23,35 @@ command %i[again resume] do |c|
|
|
|
16
23
|
c.arg_name 'SECTION_NAME'
|
|
17
24
|
c.flag [:in]
|
|
18
25
|
|
|
19
|
-
c.desc 'Backdate start date by interval or set to time [4pm|20m|2h|"yesterday noon"]'
|
|
20
|
-
c.arg_name 'DATE_STRING'
|
|
21
|
-
c.flag %i[b back started], type: DateBeginString
|
|
22
|
-
|
|
23
|
-
c.desc 'Repeat last entry matching tags. Combine multiple tags with a comma. Wildcards allowed (*, ?)'
|
|
24
|
-
c.arg_name 'TAG'
|
|
25
|
-
c.flag [:tag], type: TagArray
|
|
26
|
-
|
|
27
|
-
c.desc 'Repeat last entry matching search. Surround with
|
|
28
|
-
slashes for regex (e.g. "/query/"), start with a single quote for exact match ("\'query").'
|
|
29
|
-
c.arg_name 'QUERY'
|
|
30
|
-
c.flag [:search]
|
|
31
|
-
|
|
32
|
-
c.desc 'Perform a tag value query ("@done > two hours ago" or "@progress < 50"). May be used multiple times, combined with --bool'
|
|
33
|
-
c.arg_name 'QUERY'
|
|
34
|
-
c.flag [:val], multiple: true, must_match: REGEX_VALUE_QUERY
|
|
35
|
-
|
|
36
|
-
# c.desc '[DEPRECATED] Use alternative fuzzy matching for search string'
|
|
37
|
-
# c.switch [:fuzzy], default_value: false, negatable: false
|
|
38
|
-
|
|
39
|
-
c.desc 'Force exact search string matching (case sensitive)'
|
|
40
|
-
c.switch %i[x exact], default_value: @config.exact_match?, negatable: @config.exact_match?
|
|
41
|
-
|
|
42
|
-
c.desc 'Resume items that *don\'t* match search/tag filters'
|
|
43
|
-
c.switch [:not], default_value: false, negatable: false
|
|
44
|
-
|
|
45
|
-
c.desc 'Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]'
|
|
46
|
-
c.arg_name 'TYPE'
|
|
47
|
-
c.flag [:case], must_match: /^[csi]/, default_value: @settings.dig('search', 'case')
|
|
48
|
-
|
|
49
|
-
c.desc 'Boolean used to combine multiple tags. Use PATTERN to parse + and - as booleans'
|
|
50
|
-
c.arg_name 'BOOLEAN'
|
|
51
|
-
c.flag [:bool], must_match: REGEX_BOOL, default_value: 'PATTERN'
|
|
52
|
-
|
|
53
|
-
c.desc "Edit duplicated entry with #{Doing::Util.default_editor} before adding"
|
|
54
|
-
c.switch %i[e editor], negatable: false, default_value: false
|
|
55
|
-
|
|
56
|
-
c.desc 'Add a note'
|
|
57
|
-
c.arg_name 'TEXT'
|
|
58
|
-
c.flag %i[n note]
|
|
59
|
-
|
|
60
|
-
c.desc 'Prompt for note via multi-line input'
|
|
61
|
-
c.switch %i[ask], negatable: false, default_value: false
|
|
62
|
-
|
|
63
26
|
c.desc 'Select item to resume from a menu of matching entries'
|
|
64
27
|
c.switch %i[i interactive], negatable: false, default_value: false
|
|
65
28
|
|
|
29
|
+
add_options(:add_entry, c)
|
|
30
|
+
add_options(:search, c)
|
|
31
|
+
add_options(:tag_filter, c)
|
|
32
|
+
|
|
66
33
|
c.action do |_global_options, options, _args|
|
|
67
34
|
options[:fuzzy] = false
|
|
68
|
-
tags = options[:tag].nil? ? [] : options[:tag]
|
|
69
|
-
|
|
70
|
-
options[:case] = options[:case].normalize_case
|
|
71
35
|
|
|
72
36
|
if options[:search]
|
|
73
|
-
search = options[:search]
|
|
74
|
-
search.sub!(/^'?/, "'") if options[:exact]
|
|
75
|
-
options[:search] = search
|
|
37
|
+
options[:search] = options[:exact] ? options[:search].sub(/^'?/, "'") : options[:search]
|
|
76
38
|
end
|
|
77
39
|
|
|
78
40
|
if options[:back]
|
|
79
|
-
date = options[:back]
|
|
41
|
+
options[:date] = options[:back]
|
|
80
42
|
raise InvalidTimeExpression, 'Unable to parse date string for --back' if date.nil?
|
|
43
|
+
|
|
81
44
|
else
|
|
82
|
-
date = Time.now
|
|
45
|
+
options[:date] = Time.now
|
|
83
46
|
end
|
|
84
47
|
|
|
85
48
|
note = Doing::Note.new(options[:note])
|
|
86
49
|
note.add(Doing::Prompt.read_lines(prompt: 'Add a note')) if options[:ask]
|
|
87
50
|
|
|
88
51
|
options[:note] = note
|
|
52
|
+
options[:tag] ||= []
|
|
53
|
+
options[:tag_bool] = options[:bool]
|
|
89
54
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
opts[:tag] = tags
|
|
93
|
-
opts[:tag_bool] = options[:bool].normalize_bool
|
|
94
|
-
opts[:interactive] = options[:interactive]
|
|
95
|
-
opts[:date] = date
|
|
96
|
-
|
|
97
|
-
@wwid.repeat_last(opts)
|
|
55
|
+
@wwid.repeat_last(options)
|
|
98
56
|
end
|
|
99
57
|
end
|
data/bin/commands/archive.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# @@archive @@move
|
|
2
4
|
desc 'Move entries between sections'
|
|
3
5
|
long_desc %(Argument can be a section name to move all entries from a section,
|
|
@@ -10,7 +12,8 @@ command %i[archive move] do |c|
|
|
|
10
12
|
c.example 'doing archive Currently', desc: 'Move all entries in the Currently section to Archive section'
|
|
11
13
|
c.example 'doing archive @done', desc: 'Move all entries tagged @done to Archive'
|
|
12
14
|
c.example 'doing archive --to Later @project1', desc: 'Move all entries tagged @project1 to Later section'
|
|
13
|
-
c.example 'doing move Later --tag project1 --to Currently',
|
|
15
|
+
c.example 'doing move Later --tag project1 --to Currently',
|
|
16
|
+
desc: 'Move entries in Later tagged @project1 to Currently (move is an alias for archive)'
|
|
14
17
|
|
|
15
18
|
c.desc 'How many items to keep (ignored if archiving by tag or search)'
|
|
16
19
|
c.arg_name 'X'
|
|
@@ -23,74 +26,30 @@ command %i[archive move] do |c|
|
|
|
23
26
|
c.desc 'Label moved items with @from(SECTION_NAME)'
|
|
24
27
|
c.switch [:label], default_value: true, negatable: true
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
c
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
c.desc 'Tag boolean (AND|OR|NOT). Use PATTERN to parse + and - as booleans'
|
|
31
|
-
c.arg_name 'BOOLEAN'
|
|
32
|
-
c.flag [:bool], must_match: REGEX_BOOL, default_value: 'PATTERN'
|
|
33
|
-
|
|
34
|
-
c.desc 'Search filter'
|
|
35
|
-
c.arg_name 'QUERY'
|
|
36
|
-
c.flag [:search]
|
|
37
|
-
|
|
38
|
-
c.desc 'Perform a tag value query ("@done > two hours ago" or "@progress < 50"). May be used multiple times, combined with --bool'
|
|
39
|
-
c.arg_name 'QUERY'
|
|
40
|
-
c.flag [:val], multiple: true, must_match: REGEX_VALUE_QUERY
|
|
41
|
-
|
|
42
|
-
# c.desc '[DEPRECATED] Use alternative fuzzy matching for search string'
|
|
43
|
-
# c.switch [:fuzzy], default_value: false, negatable: false
|
|
44
|
-
|
|
45
|
-
c.desc 'Force exact search string matching (case sensitive)'
|
|
46
|
-
c.switch %i[x exact], default_value: @config.exact_match?, negatable: @config.exact_match?
|
|
47
|
-
|
|
48
|
-
c.desc 'Show items that *don\'t* match search string'
|
|
49
|
-
c.switch [:not], default_value: false, negatable: false
|
|
50
|
-
|
|
51
|
-
c.desc 'Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]'
|
|
52
|
-
c.arg_name 'TYPE'
|
|
53
|
-
c.flag [:case], must_match: /^[csi]/, default_value: @settings.dig('search', 'case')
|
|
54
|
-
|
|
55
|
-
c.desc 'Archive entries older than date
|
|
56
|
-
(Flexible date format, e.g. 1/27/2021, 2020-07-19, or Monday 3pm)'
|
|
57
|
-
c.arg_name 'DATE_STRING'
|
|
58
|
-
c.flag [:before], type: DateEndString
|
|
29
|
+
add_options(:search, c)
|
|
30
|
+
add_options(:tag_filter, c)
|
|
31
|
+
add_options(:date_filter, c)
|
|
59
32
|
|
|
60
33
|
c.action do |_global_options, options, args|
|
|
61
34
|
options[:fuzzy] = false
|
|
62
|
-
if args.empty?
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
section = args[0].cap_first
|
|
72
|
-
tags = args.length > 1 ? args[1..].map { |t| t.sub(/^@/, '').strip } : []
|
|
73
|
-
end
|
|
35
|
+
section, tags = if args.empty?
|
|
36
|
+
[@settings['current_section'], []]
|
|
37
|
+
elsif args[0] =~ /^all/i
|
|
38
|
+
['all', []]
|
|
39
|
+
elsif args[0] =~ /^@\S+/
|
|
40
|
+
['all', args.tags_to_array]
|
|
41
|
+
else
|
|
42
|
+
[args.shift.cap_first, args.tags_to_array]
|
|
43
|
+
end
|
|
74
44
|
|
|
75
45
|
raise InvalidArgument, '--keep and --count can not be used together' if options[:keep] && options[:count]
|
|
76
46
|
|
|
77
47
|
tags.concat(options[:tag]) if options[:tag]
|
|
78
48
|
|
|
79
|
-
search =
|
|
80
|
-
|
|
81
|
-
options[:
|
|
82
|
-
|
|
83
|
-
if options[:search]
|
|
84
|
-
search = options[:search]
|
|
85
|
-
search.sub!(/^'?/, "'") if options[:exact]
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
opts = options.clone
|
|
89
|
-
opts[:search] = search
|
|
90
|
-
opts[:bool] = options[:bool].normalize_bool
|
|
91
|
-
opts[:destination] = options[:to]
|
|
92
|
-
opts[:tags] = tags
|
|
49
|
+
options[:search] = options[:search].sub(/^'?/, "'") if options[:search] && options[:exact]
|
|
50
|
+
options[:destination] = options[:to]
|
|
51
|
+
options[:tags] = tags
|
|
93
52
|
|
|
94
|
-
@wwid.archive(section,
|
|
53
|
+
@wwid.archive(section, options)
|
|
95
54
|
end
|
|
96
55
|
end
|
data/bin/commands/cancel.rb
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# @@cancel
|
|
2
4
|
desc 'End last X entries with no time tracked'
|
|
3
|
-
long_desc 'Adds @done tag without datestamp so no elapsed time is recorded.
|
|
5
|
+
long_desc 'Adds @done tag without datestamp so no elapsed time is recorded.
|
|
6
|
+
Alias for `doing finish --no-date`'
|
|
4
7
|
arg_name 'COUNT'
|
|
5
8
|
command :cancel do |c|
|
|
6
9
|
c.example 'doing cancel', desc: 'Cancel the last entry'
|
|
@@ -13,90 +16,45 @@ command :cancel do |c|
|
|
|
13
16
|
c.arg_name 'NAME'
|
|
14
17
|
c.flag %i[s section]
|
|
15
18
|
|
|
16
|
-
c.desc 'Cancel the last X entries containing TAG. Separate multiple tags with comma (--tag=tag1,tag2). Wildcards allowed (*, ?)'
|
|
17
|
-
c.arg_name 'TAG'
|
|
18
|
-
c.flag [:tag], type: TagArray
|
|
19
|
-
|
|
20
|
-
c.desc 'Boolean (AND|OR|NOT) with which to combine multiple tag filters. Use PATTERN to parse + and - as booleans'
|
|
21
|
-
c.arg_name 'BOOLEAN'
|
|
22
|
-
c.flag [:bool], must_match: REGEX_BOOL, default_value: 'PATTERN'
|
|
23
|
-
|
|
24
|
-
c.desc 'Cancel the last X entries matching search filter, surround with slashes for regex (e.g. "/query.*/"), start with single quote for exact match ("\'query")'
|
|
25
|
-
c.arg_name 'QUERY'
|
|
26
|
-
c.flag [:search]
|
|
27
|
-
|
|
28
|
-
c.desc 'Perform a tag value query ("@done > two hours ago" or "@progress < 50"). May be used multiple times, combined with --bool'
|
|
29
|
-
c.arg_name 'QUERY'
|
|
30
|
-
c.flag [:val], multiple: true, must_match: REGEX_VALUE_QUERY
|
|
31
|
-
|
|
32
|
-
# c.desc '[DEPRECATED] Use alternative fuzzy matching for search string'
|
|
33
|
-
# c.switch [:fuzzy], default_value: false, negatable: false
|
|
34
|
-
|
|
35
|
-
c.desc 'Force exact search string matching (case sensitive)'
|
|
36
|
-
c.switch %i[x exact], default_value: @config.exact_match?, negatable: @config.exact_match?
|
|
37
|
-
|
|
38
|
-
c.desc 'Finish items that *don\'t* match search/tag filters'
|
|
39
|
-
c.switch [:not], default_value: false, negatable: false
|
|
40
|
-
|
|
41
|
-
c.desc 'Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]'
|
|
42
|
-
c.arg_name 'TYPE'
|
|
43
|
-
c.flag [:case], must_match: /^[csi]/, default_value: @settings.dig('search', 'case')
|
|
44
|
-
|
|
45
19
|
c.desc 'Cancel last entry (or entries) not already marked @done'
|
|
46
20
|
c.switch %i[u unfinished], negatable: false, default_value: false
|
|
47
21
|
|
|
48
22
|
c.desc 'Select item(s) to cancel from a menu of matching entries'
|
|
49
23
|
c.switch %i[i interactive], negatable: false, default_value: false
|
|
50
24
|
|
|
25
|
+
add_options(:search, c)
|
|
26
|
+
add_options(:tag_filter, c)
|
|
27
|
+
|
|
51
28
|
c.action do |_global_options, options, args|
|
|
52
29
|
options[:fuzzy] = false
|
|
53
|
-
if options[:section]
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if options[:tag].nil?
|
|
60
|
-
tags = []
|
|
61
|
-
else
|
|
62
|
-
tags = options[:tag]
|
|
63
|
-
end
|
|
30
|
+
options[:section] = if options[:section]
|
|
31
|
+
@wwid.guess_section(options[:section]) || options[:section].cap_first
|
|
32
|
+
else
|
|
33
|
+
@settings['current_section']
|
|
34
|
+
end
|
|
64
35
|
|
|
65
36
|
raise InvalidArgument, 'Only one argument allowed' if args.length > 1
|
|
66
37
|
|
|
67
|
-
|
|
38
|
+
unless args.empty? || args[0] =~ /\d+/
|
|
39
|
+
raise InvalidArgument, 'Invalid argument (specify number of recent items to mark @done)'
|
|
68
40
|
|
|
69
|
-
if options[:interactive]
|
|
70
|
-
count = 0
|
|
71
|
-
else
|
|
72
|
-
count = args[0] ? args[0].to_i : 1
|
|
73
41
|
end
|
|
74
42
|
|
|
75
|
-
|
|
43
|
+
options[:count] = if options[:interactive]
|
|
44
|
+
0
|
|
45
|
+
else
|
|
46
|
+
args[0] ? args[0].to_i : 1
|
|
47
|
+
end
|
|
76
48
|
|
|
77
|
-
if options[:search]
|
|
78
|
-
search = options[:search]
|
|
79
|
-
search.sub!(/^'?/, "'") if options[:exact]
|
|
80
|
-
end
|
|
49
|
+
options[:search] = options[:search].sub(/^'?/, "'") if options[:search] && options[:exact]
|
|
81
50
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
interactive: options[:interactive],
|
|
89
|
-
not: options[:not],
|
|
90
|
-
search: search,
|
|
91
|
-
section: section,
|
|
92
|
-
sequential: false,
|
|
93
|
-
tag: tags,
|
|
94
|
-
tag_bool: options[:bool].normalize_bool,
|
|
95
|
-
tags: ['done'],
|
|
96
|
-
unfinished: options[:unfinished],
|
|
97
|
-
val: options[:val]
|
|
98
|
-
}
|
|
51
|
+
options[:case] = options[:case].normalize_case
|
|
52
|
+
options[:date] = false
|
|
53
|
+
options[:sequential] = false
|
|
54
|
+
options[:tag] ||= []
|
|
55
|
+
options[:tag_bool] = options[:bool].normalize_bool
|
|
56
|
+
options[:tags] = ['done']
|
|
99
57
|
|
|
100
|
-
@wwid.tag_last(
|
|
58
|
+
@wwid.tag_last(options)
|
|
101
59
|
end
|
|
102
60
|
end
|
data/bin/commands/changes.rb
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
# @@changelog @@changes
|
|
2
|
+
|
|
3
|
+
MARKDOWN_THEME = {
|
|
4
|
+
em: %i[white dark],
|
|
5
|
+
header: %i[cyan bold],
|
|
6
|
+
hr: :yellow,
|
|
7
|
+
link: %i[bright_cyan underline],
|
|
8
|
+
list: :yellow,
|
|
9
|
+
strong: %i[yellow bold],
|
|
10
|
+
table: :yellow,
|
|
11
|
+
quote: :yellow,
|
|
12
|
+
image: :bright_black,
|
|
13
|
+
note: :yellow,
|
|
14
|
+
comment: :bright_black
|
|
15
|
+
}.deep_freeze
|
|
16
|
+
|
|
17
|
+
CHANGE_RX = /^(?:(?:(?:[<>=]|p(?:rior)|b(?:efore)|o(?:lder)|s(?:ince)|a(?:fter)|n(?:ewer))? *[\d.*?]+ *)+|(?:[\d.]+ *-+ *[\d.]+))$/
|
|
18
|
+
|
|
2
19
|
desc 'List recent changes in Doing'
|
|
3
20
|
long_desc %(Display a formatted list of changes in recent versions.
|
|
4
21
|
|
|
@@ -12,12 +29,18 @@ command %i[changes changelog] do |c|
|
|
|
12
29
|
and PATCH are optional. Use > or < to see all changes since or prior
|
|
13
30
|
to a version.)
|
|
14
31
|
c.arg_name 'VERSION'
|
|
15
|
-
c.flag %i[l lookup], must_match:
|
|
32
|
+
c.flag %i[l lookup], must_match: CHANGE_RX
|
|
16
33
|
|
|
17
34
|
c.desc %(Show changelogs matching search terms (uses pattern-based searching).
|
|
18
35
|
Add slashes to search with regular expressions, e.g. `--search "/output.*flag/"`)
|
|
19
36
|
c.flag %i[s search]
|
|
20
37
|
|
|
38
|
+
c.desc 'Only output changes, no version numbers, headers, or dates'
|
|
39
|
+
c.switch %i[C changes], default_value: false, negatable: false
|
|
40
|
+
|
|
41
|
+
c.desc 'Output raw Markdown'
|
|
42
|
+
c.switch %i[m md markdown], default_value: false, negatable: false
|
|
43
|
+
|
|
21
44
|
c.example 'doing changes', desc: 'View changes in the current version'
|
|
22
45
|
c.example 'doing changes --all', desc: 'See the entire changelog'
|
|
23
46
|
c.example 'doing changes --lookup 2.0.21', desc: 'See changes from version 2.0.21'
|
|
@@ -25,9 +48,8 @@ command %i[changes changelog] do |c|
|
|
|
25
48
|
c.example 'doing changes --search "tags +bool"', desc: 'See all changes containing "tags" and "bool"'
|
|
26
49
|
c.example 'doing changes -l "> 2.1" -s "pattern"', desc: 'Lookup and search can be combined'
|
|
27
50
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
cl = Doing::Changes.new(lookup: options[:lookup], search: options[:search])
|
|
51
|
+
c.action do |_global_options, options, _args|
|
|
52
|
+
cl = Doing::Changes.new(lookup: options[:lookup], search: options[:search], changes_only: options[:changes])
|
|
31
53
|
|
|
32
54
|
content = if options[:all] || options[:search] || options[:lookup]
|
|
33
55
|
cl.to_s
|
|
@@ -35,7 +57,12 @@ command %i[changes changelog] do |c|
|
|
|
35
57
|
cl.latest
|
|
36
58
|
end
|
|
37
59
|
|
|
38
|
-
parsed =
|
|
60
|
+
parsed = if options[:markdown] || !$stdout.isatty
|
|
61
|
+
content
|
|
62
|
+
else
|
|
63
|
+
TTY::Markdown.parse(content, width: 80, theme: MARKDOWN_THEME, symbols: { override: { bullet: '•' } })
|
|
64
|
+
end
|
|
65
|
+
|
|
39
66
|
Doing::Pager.paginate = true
|
|
40
67
|
Doing::Pager.page parsed
|
|
41
68
|
end
|
data/bin/commands/colors.rb
CHANGED
|
@@ -5,10 +5,12 @@ command :colors do |c|
|
|
|
5
5
|
bgs = []
|
|
6
6
|
fgs = []
|
|
7
7
|
@colors::attributes.each do |color|
|
|
8
|
+
colname = color.to_s
|
|
9
|
+
colname << " (#{color.to_s.sub(/bold/, 'bright')})" if colname =~ /bold/
|
|
8
10
|
if color.to_s =~ /bg/
|
|
9
|
-
bgs.push("#{@colors.send(color, " ")}#{@colors.default} <-- #{
|
|
11
|
+
bgs.push("#{@colors.send(color, " ")}#{@colors.default} <-- #{colname}")
|
|
10
12
|
else
|
|
11
|
-
fgs.push("#{@colors.send(color, "XXXX")}#{@colors.default} <-- #{
|
|
13
|
+
fgs.push("#{@colors.send(color, "XXXX")}#{@colors.default} <-- #{colname}")
|
|
12
14
|
end
|
|
13
15
|
end
|
|
14
16
|
out = []
|
data/bin/commands/commands.rb
CHANGED
|
@@ -27,9 +27,11 @@ command :commands do |c|
|
|
|
27
27
|
Doing::Prompt.choose_from(available,
|
|
28
28
|
prompt: 'Select commands to enable',
|
|
29
29
|
multiple: true,
|
|
30
|
-
sorted: true)
|
|
30
|
+
sorted: true)
|
|
31
31
|
end
|
|
32
|
-
|
|
32
|
+
raise UserCancelled unless to_enable
|
|
33
|
+
|
|
34
|
+
to_enable.strip.split("\n").each do |cmd|
|
|
33
35
|
default_command = File.join(File.dirname(__FILE__), "#{cmd}.rb")
|
|
34
36
|
custom_command = File.join(File.expand_path(custom_dir), "#{cmd}.rb")
|
|
35
37
|
unless File.exist?(default_command) || File.exist?(custom_command)
|