na 1.2.60 → 1.2.62

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: c10e15eae9292e8245903b543c8adbb990be7fe7f166ee7d8636e557b4324aa5
4
- data.tar.gz: e625f1a56c6aa903ba273909b0dad8e230313ab119276d44f76a58da51c8561d
3
+ metadata.gz: 7593e49883f52039a97b3ab2120d8ff33d4fc96e26668c0ced93925ccbdb50dd
4
+ data.tar.gz: a2d81d64424252333b43892e2084b6723f2a86bb49b21bf7e4b2b41910ac276f
5
5
  SHA512:
6
- metadata.gz: e84356c63836c19be6d87c3acb213c3741d8476b9c9ce4f03df6ce5024b21cdb6e0ba01dcdeca8bda0a8fbeea6a8fbd4bf42db6a44c77b574162f94e2e1bb868
7
- data.tar.gz: 93f0d4512a6fed663e7717e2ba3a64358dd8f3d931aa39ae0a44744ba0c479c6b0b3a24fd312bf7c754f24b3be07adf46d85342065e18fc012a52728069a6bf9
6
+ metadata.gz: aeb67a3726ca053efe7f453659d40bb87a776f1d52f7bd40d843821ee3569edd8ad5edf3e3e0d5f6d4b3f1ec850f3215f21bee5fda495faf8024771dd4115ca1
7
+ data.tar.gz: afa3e3a0cdeaffd7d400f1be9351ef4ed832e0b60311610055a6249d6645e649bb51cf1586b52176620b18665f929ffef8543d110ebc721c9cdbb15fa6fbec8c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ### 1.2.62
2
+
3
+ 2023-10-05 08:39
4
+
5
+ #### FIXED
6
+
7
+ - Return empty if `na projects QUERY` has no results
8
+
9
+ ### 1.2.61
10
+
11
+ 2023-10-03 12:44
12
+
13
+ #### NEW
14
+
15
+ - `--priority` (`-p`) flag for `na next`, allows you to only display actions matching a certain @priority value. Can be used multiple times, or combine multiple values with a comma. Allows <> comparisons, and if more than one value is provided, automatically does an OR search
16
+
1
17
  ### 1.2.60
2
18
 
3
19
  2023-10-03 12:31
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.2.60)
4
+ na (1.2.62)
5
5
  chronic (~> 0.10, >= 0.10.2)
6
6
  gli (~> 2.21.0)
7
7
  mdless (~> 1.0, >= 1.0.32)
data/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  _If you're one of the rare people like me who find this useful, feel free to
10
10
  [buy me some coffee][donate]._
11
11
 
12
- The current version of `na` is 1.2.60
12
+ The current version of `na` is 1.2.62
13
13
  .
14
14
 
15
15
  `na` ("next action") is a command line tool designed to make it easy to see what your next actions are for any project, right from the command line. It works with TaskPaper-formatted files (but any plain text format will do), looking for `@na` tags (or whatever you specify) in todo files in your current folder.
@@ -77,7 +77,7 @@ SYNOPSIS
77
77
  na [global options] command [command options] [arguments...]
78
78
 
79
79
  VERSION
80
- 1.2.60
80
+ 1.2.62
81
81
 
82
82
  GLOBAL OPTIONS
83
83
  -a, --add - Add a next action (deprecated, for backwards compatibility)
@@ -295,6 +295,7 @@ COMMAND OPTIONS
295
295
  --nest - Output actions nested by file
296
296
  --[no-]notes - Include notes in output
297
297
  --omnifocus - Output actions nested by file and project
298
+ -p, --prio, --priority=PRIORITY - Match actions with priority, allows <>= comparison (may be used more than once, default: none)
298
299
  --proj, --project=PROJECT[/SUBPROJECT] - Show actions from a specific project (default: none)
299
300
  --regex - Search query is regular expression
300
301
  --save=TITLE - Save this search for future use (default: none)
@@ -411,6 +412,7 @@ COMMAND OPTIONS
411
412
  --nest - Output actions nested by file
412
413
  --[no-]notes - Include notes in output
413
414
  --omnifocus - Output actions nested by file and project
415
+ -p, --prio, --priority=PRIORITY - Match actions with priority, allows <>= comparison (may be used more than once, default: none)
414
416
  --proj, --project=PROJECT[/SUBPROJECT] - Show actions from a specific project (default: none)
415
417
  --regex - Search query is regular expression
416
418
  --save=TITLE - Save this search for future use (default: none)
data/bin/commands/next.rb CHANGED
@@ -42,6 +42,10 @@ class App
42
42
  c.arg_name 'TAG'
43
43
  c.flag %i[tagged], multiple: true
44
44
 
45
+ c.desc 'Match actions with priority, allows <>= comparison'
46
+ c.arg_name 'PRIORITY'
47
+ c.flag %i[p prio priority], multiple: true
48
+
45
49
  c.desc 'Filter results using search terms'
46
50
  c.arg_name 'QUERY'
47
51
  c.flag %i[search find grep], multiple: true
@@ -116,6 +120,20 @@ class App
116
120
 
117
121
  search = search.gsub(/,/, '').gsub(/ +/, ' ') unless search.nil?
118
122
 
123
+ if options[:priority].count.positive?
124
+ prios = options[:priority].join(',').split(/,/)
125
+ options[:or] = true if prios.count > 1
126
+ prios.each do |p|
127
+ options[:tagged] << if p =~ /^[<>=]{1,2}/
128
+ "priority#{p}"
129
+ else
130
+ "priority=#{p}"
131
+ end
132
+ end
133
+ end
134
+
135
+ pp options[:tagged]
136
+
119
137
  all_req = options[:tagged].join(' ') !~ /(?<=[, ])[+!-]/ && !options[:or]
120
138
  tags = []
121
139
  options[:tagged].join(',').split(/ *, */).each do |arg|
@@ -581,6 +581,7 @@ module NA
581
581
  NA.notify("#{NA.theme[:warning]}No matches, loosening search", debug: true)
582
582
  match_working_dir(search, distance: 2, require_last: false)
583
583
  else
584
+ NA.notify("Matched files: {x}#{dirs.join(', ')}", debug: true)
584
585
  dirs
585
586
  end
586
587
  end
@@ -767,7 +768,10 @@ module NA
767
768
  else
768
769
  match_working_dir(query)
769
770
  end
771
+
770
772
  target = files.count > 1 ? NA.select_file(files) : files[0]
773
+ return if target.nil?
774
+
771
775
  projects = find_projects(target)
772
776
  projects.each do |proj|
773
777
  parts = proj.project.split(/:/)
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.2.60'
2
+ VERSION = '1.2.62'
3
3
  end
data/src/_README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  _If you're one of the rare people like me who find this useful, feel free to
10
10
  [buy me some coffee][donate]._
11
11
 
12
- The current version of `na` is <!--VER-->1.2.59<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.2.61<!--END VER-->.
13
13
 
14
14
  `na` ("next action") is a command line tool designed to make it easy to see what your next actions are for any project, right from the command line. It works with TaskPaper-formatted files (but any plain text format will do), looking for `@na` tags (or whatever you specify) in todo files in your current folder.
15
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: na
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.60
4
+ version: 1.2.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-03 00:00:00.000000000 Z
11
+ date: 2023-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake