na 1.1.16 → 1.1.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53c4f2d9b3198892662e241d57c5d5bea699736112e91bba9551b7a393b57e06
4
- data.tar.gz: 8bfd9f4bfbdd36bd0547a11e7ec88a43873f21aa1a3b9069020884a866646bdd
3
+ metadata.gz: ca265b21ae87e7ce77028f5a5a61d335d54136998db65495aacda0d8f6ea1a67
4
+ data.tar.gz: 10c5a7a4d7dda293f9d10cee00255a3c7e91e36be5adaf57677ff57cac8352c4
5
5
  SHA512:
6
- metadata.gz: 33855d0a87b71590afb538be498addfa793a13f3a6865b6c9ccfc1691ded319c98df726f4960f95d70202d38106ec5a1c728c29d40b3e477b597f873d289b3fc
7
- data.tar.gz: ce9ac4455e0018b2ff8df66d93c938779f831b8db722551a525e8bf49c1240b51038420d46a60d1e76c7d4ccd0d1964eadcfd5d28020667fd2c5ab78e9f3f1cc
6
+ metadata.gz: cce03bc78f6622640b3d707b804af98838782786a6b9d026f50ab97715611a34fe26829d1c3b09850679779b5c838e8b41168922973f5e4cf94d3b25859c6746
7
+ data.tar.gz: aa8965262c15291fadada3b61be77d7da36710f4a77b4e32a3909e072c30b6a67fb3c5aa8969bb6361e71cbf6efbf7bec8cf9400e0646ba10a4246e82e526359
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ### 1.1.18
2
+
3
+ 2022-10-06 17:23
4
+
5
+ #### FIXED
6
+
7
+ - Update help to match new default AND searches
8
+
9
+ ### 1.1.17
10
+
11
+ 2022-10-06 17:02
12
+
13
+ #### CHANGED
14
+
15
+ - Default to AND search with `tagged` unless a "+" or "!" is specified
16
+
1
17
  ### 1.1.16
2
18
 
3
19
  2022-10-06 16:47
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.1.16)
4
+ na (1.1.17)
5
5
  chronic (~> 0.10, >= 0.10.2)
6
6
  gli (~> 2.21.0)
7
7
  tty-reader (~> 0.9, >= 0.9.0)
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.1.16
12
+ The current version of `na` is 1.1.18
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.
@@ -152,7 +152,7 @@ EXAMPLES
152
152
 
153
153
  Example: `na find cool feature idea`
154
154
 
155
- Unless `--exact` is specified, search is tokenized and combined with OR, so `na find cool feature idea` translates to `cool OR feature OR idea`, matching any string that contains any of the words. To make a token required, add a `+` before it (e.g. `cool +feature idea` is `(cool OR idea) AND feature`). Wildcards allowed (`*` and `?`), use `--regex` to interpret the search as a regular expression. Use `-v` to invert the results (display non-matching actions only).
155
+ Unless `--exact` is specified, search is tokenized and combined with AND, so `na find cool feature idea` translates to `cool AND feature AND idea`, matching any string that contains all of the words. To make a token required and others optional, add a `+` before it (e.g. `cool +feature idea` is `(cool OR idea) AND feature`). Wildcards allowed (`*` and `?`), use `--regex` to interpret the search as a regular expression. Use `-v` to invert the results (display non-matching actions only).
156
156
 
157
157
  ```
158
158
  NAME
@@ -233,7 +233,7 @@ EXAMPLES
233
233
 
234
234
  Example: `na tagged feature +maybe`.
235
235
 
236
- Separate multiple tags with spaces or commas. By default tags are combined with OR, so actions matching any of the tags listed will be displayed. Use `+` to make a tag required and `!` to negate a tag (only display if the action does _not_ contain the tag). Use `-v` to invert the search and display all actions that _don't_ match.
236
+ Separate multiple tags with spaces or commas. By default tags are combined with AND, so actions matching all of the tags listed will be displayed. Use `+` to make a tag required and `!` to negate a tag (only display if the action does _not_ contain the tag). When `+` and/or `!` are used, undecorated tokens become optional matches. Use `-v` to invert the search and display all actions that _don't_ match.
237
237
 
238
238
  ```
239
239
  NAME
@@ -254,7 +254,7 @@ EXAMPLES
254
254
  # Show all actions tagged @maybe
255
255
  na tagged +maybe
256
256
 
257
- # Show all actions tagged either @feature or @idea, recurse 3 levels
257
+ # Show all actions tagged @feature and @idea, recurse 3 levels
258
258
  na tagged -d 3 feature idea
259
259
  ```
260
260
 
data/bin/na CHANGED
@@ -235,9 +235,8 @@ class App
235
235
  (partial matches allowed). Add a + before a token to make it required, e.g. `na find +feature +maybe`'
236
236
  arg_name 'PATTERN'
237
237
  command %i[find grep] do |c|
238
- c.example 'na find feature +idea +swift', desc: 'Find all actions containing feature, idea, and swift'
238
+ c.example 'na find feature idea swift', desc: 'Find all actions containing feature, idea, and swift'
239
239
  c.example 'na find -x feature idea', desc: 'Find all actions containing the exact text "feature idea"'
240
- c.example 'na find -d 3 swift obj-c', desc: 'Find all actions 3 directories deep containing either swift or obj-c'
241
240
 
242
241
  c.desc 'Interpret search pattern as regular expression'
243
242
  c.switch %i[e regex], negatable: false
@@ -316,9 +315,9 @@ class App
316
315
  You can specify values using TAG=VALUE pairs.'
317
316
  arg_name 'TAG [VALUE]'
318
317
  command %i[tagged] do |c|
319
- c.example 'na tagged +maybe', desc: 'Show all actions tagged @maybe'
320
- c.example 'na tagged -d 3 feature idea', desc: 'Show all actions tagged either @feature or @idea, recurse 3 levels'
321
- c.example 'na tagged +priority=5', desc: 'Show actions with @priority(5)'
318
+ c.example 'na tagged maybe', desc: 'Show all actions tagged @maybe'
319
+ c.example 'na tagged -d 3 feature idea', desc: 'Show all actions tagged @feature and @idea, recurse 3 levels'
320
+ c.example 'na tagged priority>=4', desc: 'Show actions with @priority(4) or @priority(5)'
322
321
 
323
322
  c.desc 'Recurse to depth'
324
323
  c.arg_name 'DEPTH'
@@ -344,6 +343,8 @@ class App
344
343
  end
345
344
 
346
345
  tags = []
346
+
347
+ all_req = args.join(' ') !~ /[+!\-]/
347
348
  args.join(',').split(/ *, */).each do |arg|
348
349
  # TODO: <> comparisons do nothing right now
349
350
  m = arg.match(/^(?<req>[+\-!])?(?<tag>[^ =<>*$\^]+)(?:(?<op>[=<>*$\^]+)(?<val>.*?))?$/)
@@ -351,7 +352,7 @@ class App
351
352
  tag: m['tag'],
352
353
  comp: m['op'],
353
354
  value: m['val'],
354
- required: !m['req'].nil? && m['req'] == '+',
355
+ required: all_req || (!m['req'].nil? && m['req'] == '+'),
355
356
  negate: !m['req'].nil? && m['req'] =~ /[!\-]/
356
357
  })
357
358
  end
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.1.16'
2
+ VERSION = '1.1.18'
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.1.15<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.1.17<!--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
 
@@ -151,7 +151,7 @@ EXAMPLES
151
151
 
152
152
  Example: `na find cool feature idea`
153
153
 
154
- Unless `--exact` is specified, search is tokenized and combined with OR, so `na find cool feature idea` translates to `cool OR feature OR idea`, matching any string that contains any of the words. To make a token required, add a `+` before it (e.g. `cool +feature idea` is `(cool OR idea) AND feature`). Wildcards allowed (`*` and `?`), use `--regex` to interpret the search as a regular expression. Use `-v` to invert the results (display non-matching actions only).
154
+ Unless `--exact` is specified, search is tokenized and combined with AND, so `na find cool feature idea` translates to `cool AND feature AND idea`, matching any string that contains all of the words. To make a token required and others optional, add a `+` before it (e.g. `cool +feature idea` is `(cool OR idea) AND feature`). Wildcards allowed (`*` and `?`), use `--regex` to interpret the search as a regular expression. Use `-v` to invert the results (display non-matching actions only).
155
155
 
156
156
  ```
157
157
  NAME
@@ -232,7 +232,7 @@ EXAMPLES
232
232
 
233
233
  Example: `na tagged feature +maybe`.
234
234
 
235
- Separate multiple tags with spaces or commas. By default tags are combined with OR, so actions matching any of the tags listed will be displayed. Use `+` to make a tag required and `!` to negate a tag (only display if the action does _not_ contain the tag). Use `-v` to invert the search and display all actions that _don't_ match.
235
+ Separate multiple tags with spaces or commas. By default tags are combined with AND, so actions matching all of the tags listed will be displayed. Use `+` to make a tag required and `!` to negate a tag (only display if the action does _not_ contain the tag). When `+` and/or `!` are used, undecorated tokens become optional matches. Use `-v` to invert the search and display all actions that _don't_ match.
236
236
 
237
237
  ```
238
238
  NAME
@@ -253,7 +253,7 @@ EXAMPLES
253
253
  # Show all actions tagged @maybe
254
254
  na tagged +maybe
255
255
 
256
- # Show all actions tagged either @feature or @idea, recurse 3 levels
256
+ # Show all actions tagged @feature and @idea, recurse 3 levels
257
257
  na tagged -d 3 feature idea
258
258
  ```
259
259
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: na
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.16
4
+ version: 1.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra