doing 1.0.88 → 1.0.89

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd3101f8217fd3af3a0aa5fa57b2b7daf72aeb15510f83a361971403338c293e
4
- data.tar.gz: 9bfc051f1129c40db87ac8c31a1eb88d0e9f1b1bc96b6f697e42fdb5351e3d35
3
+ metadata.gz: 9a776b386e41f7af1402c85780ab0082f7bf8a9984f02b175cd0c5e9e5dcaa5c
4
+ data.tar.gz: 7737382bca829f2c5b64ca81fb257a4166832b34c0361b82d5a71009a71927e0
5
5
  SHA512:
6
- metadata.gz: 3f7f0fe38daa1f63757dd4b3fb9b6c8a8d55415d47d74c58b2f4450327954381020279e353a44a790142da3802ffc2f6ce1b828ace7fbf3b0042a050674b7084
7
- data.tar.gz: c36980be8fb2b8ae10fa750965eb2faa0c3ba4a0230e2e68a12cf09195b4fa16e70851521e0437d5e744fd954b9d1f50b39e7e31c6704592d03d51786be80a99
6
+ metadata.gz: ea87d615dc5e8d92e307bab0f6adb938d9b2eaaa3732a8a148de81daad1b7dff7258a45aec1e306e06912383077ca0b5d01eef7ed06bd13b3c55ef11f6d8bbba
7
+ data.tar.gz: '0980e9622d44d2e894a99316a2254a55d76dcbe64b3ec9b5302539cc71ada223fd258af9a42c0b190e3a515e36e309fa56c20d5b8c7a21bb9f390a47ca16f1db'
data/README.md CHANGED
@@ -27,7 +27,7 @@ If there's something I want to look at later but doesn't need to be added to a t
27
27
 
28
28
  ## Installation
29
29
 
30
- The current version of `doing` is <!--VER-->1.0.87<!--END VER-->.
30
+ The current version of `doing` is <!--VER-->1.0.88<!--END VER-->.
31
31
 
32
32
  $ [sudo] gem install doing
33
33
 
data/bin/doing CHANGED
@@ -292,10 +292,13 @@ command :select do |c|
292
292
  c.arg_name 'SECTION'
293
293
  c.flag %i[m move]
294
294
 
295
- c.desc 'Initial search query for filtering'
295
+ c.desc 'Initial search query for filtering. Matching is fuzzy. For exact matching, start query with a single quote, e.g. `--query "\'search"'
296
296
  c.arg_name 'QUERY'
297
297
  c.flag %i[q query]
298
298
 
299
+ c.desc 'Use --no-menu to skip the interactive menu. Use with --query to filter items and act on results automatically. Test with `--output doing` to preview matches.'
300
+ c.switch %i[menu], negatable: true, default_value: true
301
+
299
302
  c.desc 'Cancel selected items (add @done without timestamp)'
300
303
  c.switch %i[c cancel], negatable: false, default_value: false
301
304
 
@@ -311,7 +314,7 @@ command :select do |c|
311
314
  c.desc 'Add flag to selected item(s)'
312
315
  c.switch %i[flag], negatable: false, default_value: false
313
316
 
314
- c.desc 'Perform action without confirmation'
317
+ c.desc 'Perform action without confirmation.'
315
318
  c.switch %i[force], negatable: false, default_value: false
316
319
 
317
320
  c.desc 'Save selected entries to file using --output format'
@@ -323,6 +326,8 @@ command :select do |c|
323
326
  c.flag %i[o output], must_match: /^(?:doing|taskpaper|html|csv|json|template|timeline)$/i
324
327
 
325
328
  c.action do |_global_options, options, args|
329
+ exit_now! "--no-menu requires --query" if !options[:menu] && !options[:query]
330
+
326
331
  wwid.interactive(options)
327
332
  end
328
333
  end
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.88'
2
+ VERSION = '1.0.89'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -817,7 +817,7 @@ class WWID
817
817
  ' | ',
818
818
  item['title']
819
819
  ]
820
- if opt[:section] =~ /^all/i
820
+ if section =~ /^all/i
821
821
  out.concat([
822
822
  ' (',
823
823
  item['section'],
@@ -834,7 +834,14 @@ class WWID
834
834
  '--bind ctrl-a:select-all',
835
835
  %(-q "#{opt[:query]}")
836
836
  ]
837
+ if !opt[:menu]
838
+ exit_now! "Can't skip menu when no query is provided" unless opt[:query]
839
+
840
+ fzf_args.concat([%(--filter="#{opt[:query]}"), '--no-sort'])
841
+ end
842
+
837
843
  res = `echo #{Shellwords.escape(options.join("\n"))}|#{fzf} #{fzf_args.join(' ')}`
844
+ `echo '#{Shellwords.escape(options.join("\n"))}|#{fzf} #{fzf_args.join(' ')}' >> test.txt`
838
845
  selected = []
839
846
  res.split(/\n/).each do |item|
840
847
  idx = item.match(/^(\d+)\)/)[1].to_i
@@ -1856,11 +1863,11 @@ class WWID
1856
1863
  end
1857
1864
  end
1858
1865
  if opt[:output] == 'json'
1859
- out = {
1866
+ puts JSON.pretty_generate({
1860
1867
  'section' => section,
1861
1868
  'items' => items_out,
1862
1869
  'timers' => tag_times(format: 'json', sort_by_name: opt[:sort_tags], sort_order: opt[:tag_order])
1863
- }.to_json
1870
+ })
1864
1871
  elsif opt[:output] == 'timeline'
1865
1872
  template = <<~EOTEMPLATE
1866
1873
  <!doctype html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.88
4
+ version: 1.0.89
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra