na 1.2.21 → 1.2.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/Gemfile.lock +2 -1
- data/README.md +9 -5
- data/bin/na +15 -9
- data/lib/na/action.rb +1 -1
- data/lib/na/colors.rb +1 -1
- data/lib/na/next_action.rb +18 -15
- data/lib/na/version.rb +1 -1
- data/src/_README.md +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 156cd1491d6307f4e28005d50c7b7fd0bd9d40da460533fa5a52e0a472ead137
|
4
|
+
data.tar.gz: fc1900ffb0aa9984f039aa9ca8f3b85fb787069f31a7ed2d071c786b4fe2638b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 190d47fd1308faf2401234d9dc28c02ed61c89888a5fa96139ffad51a6ff41f0f48babb90971c132c3e890abeaf3177b878fa94363bd8a4f534b2eab7dadf43c
|
7
|
+
data.tar.gz: 6e40bf25ec1e3dd609181c467c4d885efbd9a634e8ab90424f4d443683d01d8594bace90df10c47cc12a498caae12e32efff20d0ad2d749508406bd838b05401
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,27 @@
|
|
1
|
+
### 1.2.23
|
2
|
+
|
3
|
+
2023-06-05 10:42
|
4
|
+
|
5
|
+
#### FIXED
|
6
|
+
|
7
|
+
- Actually implement the --template option
|
8
|
+
|
9
|
+
### 1.2.22
|
10
|
+
|
11
|
+
2023-06-05 10:35
|
12
|
+
|
13
|
+
#### NEW
|
14
|
+
|
15
|
+
- Global `--template PATH` option to define a template for new files, can be added to .na.rc
|
16
|
+
|
17
|
+
#### IMPROVED
|
18
|
+
|
19
|
+
- Help verbiage and examples
|
20
|
+
|
21
|
+
#### FIXED
|
22
|
+
|
23
|
+
- Variable assignment warnings
|
24
|
+
|
1
25
|
### 1.2.20
|
2
26
|
|
3
27
|
2023-05-09 10:40
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
na (1.2.
|
4
|
+
na (1.2.23)
|
5
5
|
chronic (~> 0.10, >= 0.10.2)
|
6
6
|
gli (~> 2.21.0)
|
7
7
|
mdless (~> 1.0, >= 1.0.32)
|
@@ -33,6 +33,7 @@ GEM
|
|
33
33
|
PLATFORMS
|
34
34
|
arm64-darwin-20
|
35
35
|
arm64-darwin-21
|
36
|
+
x86_64-darwin-20
|
36
37
|
|
37
38
|
DEPENDENCIES
|
38
39
|
minitest (~> 5.14)
|
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.
|
12
|
+
The current version of `na` is 1.2.23
|
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,22 +77,23 @@ SYNOPSIS
|
|
77
77
|
na [global options] command [command options] [arguments...]
|
78
78
|
|
79
79
|
VERSION
|
80
|
-
1.2.
|
80
|
+
1.2.23
|
81
81
|
|
82
82
|
GLOBAL OPTIONS
|
83
83
|
-a, --add - Add a next action (deprecated, for backwards compatibility)
|
84
84
|
--add_at=POSITION - Add all new/moved entries at [s]tart or [e]nd of target project (default: start)
|
85
85
|
--[no-]color - Colorize output (default: enabled)
|
86
86
|
--cwd_as=TYPE - Use current working directory as [p]roject, [t]ag, or [n]one (default: none)
|
87
|
-
-d, --depth=DEPTH - Recurse to depth (default:
|
87
|
+
-d, --depth=DEPTH - Recurse to depth (default: 1)
|
88
88
|
--[no-]debug - Display verbose output
|
89
89
|
--ext=EXT - File extension to consider a todo file (default: taskpaper)
|
90
|
-
-f, --file=PATH - Use a single file as global todo, use
|
90
|
+
-f, --file=PATH - Use a single file as global todo, use initconfig to make permanent (default: none)
|
91
91
|
--help - Show this message
|
92
92
|
-n, --note - Prompt for additional notes (deprecated, for backwards compatibility)
|
93
93
|
-p, --priority=PRIORITY - Set a priority 0-5 (deprecated, for backwards compatibility) (default: none)
|
94
94
|
-r, --[no-]recurse - Recurse 3 directories deep (deprecated, for backwards compatability)
|
95
95
|
-t, --na_tag=TAG - Tag to consider a next action (default: na)
|
96
|
+
--template=PATH - Provide a template for new/blank todo files, use initconfig to make permanent (default: none)
|
96
97
|
--version - Display the program version
|
97
98
|
|
98
99
|
COMMANDS
|
@@ -204,7 +205,7 @@ SYNOPSIS
|
|
204
205
|
na [global options] find [command options] PATTERN
|
205
206
|
|
206
207
|
DESCRIPTION
|
207
|
-
Search tokens are separated by spaces. Actions matching all tokens in the pattern will be shown (partial matches allowed). Add a + before a token to make it required, e.g. `na find +feature +maybe
|
208
|
+
Search tokens are separated by spaces. Actions matching all tokens in the pattern will be shown (partial matches allowed). Add a + before a token to make it required, e.g. `na find +feature +maybe`, add a - or ! to ignore matches containing that token.
|
208
209
|
|
209
210
|
COMMAND OPTIONS
|
210
211
|
-d, --depth=DEPTH - Recurse to depth (default: none)
|
@@ -226,6 +227,9 @@ EXAMPLES
|
|
226
227
|
# Find all actions containing feature, idea, and swift
|
227
228
|
na find feature idea swift
|
228
229
|
|
230
|
+
# Find all actions containing feature and idea but NOT swift
|
231
|
+
na find feature idea -swift
|
232
|
+
|
229
233
|
# Find all actions containing the exact text "feature idea"
|
230
234
|
na find -x feature idea
|
231
235
|
```
|
data/bin/na
CHANGED
@@ -43,10 +43,14 @@ class App
|
|
43
43
|
arg_name 'PRIORITY'
|
44
44
|
flag %i[p priority]
|
45
45
|
|
46
|
-
desc 'Use a single file as global todo, use
|
46
|
+
desc 'Use a single file as global todo, use initconfig to make permanent'
|
47
47
|
arg_name 'PATH'
|
48
48
|
flag %i[f file]
|
49
49
|
|
50
|
+
desc 'Provide a template for new/blank todo files, use initconfig to make permanent'
|
51
|
+
arg_name 'PATH'
|
52
|
+
flag %[template]
|
53
|
+
|
50
54
|
desc 'Use current working directory as [p]roject, [t]ag, or [n]one'
|
51
55
|
arg_name 'TYPE'
|
52
56
|
flag %i[cwd_as], must_match: /^[ptn].*?$/i, default_value: 'none'
|
@@ -274,7 +278,7 @@ class App
|
|
274
278
|
res = NA.yn(NA::Color.template('{by}Specified file not found, create it'), default: true)
|
275
279
|
if res
|
276
280
|
basename = File.basename(target, ".#{NA.extension}")
|
277
|
-
NA.create_todo(target, basename)
|
281
|
+
NA.create_todo(target, basename, template: global_options[:template])
|
278
282
|
else
|
279
283
|
puts NA::Color.template('{r}Cancelled{x}')
|
280
284
|
Process.exit 1
|
@@ -286,7 +290,7 @@ class App
|
|
286
290
|
res = NA.yn(NA::Color.template('{by}Specified file not found, create it'), default: true)
|
287
291
|
if res
|
288
292
|
basename = File.basename(target, ".#{NA.extension}")
|
289
|
-
NA.create_todo(target, basename)
|
293
|
+
NA.create_todo(target, basename, template: global_options[:template])
|
290
294
|
else
|
291
295
|
puts NA::Color.template('{r}Cancelled{x}')
|
292
296
|
Process.exit 1
|
@@ -315,7 +319,7 @@ class App
|
|
315
319
|
NA.notify('{r}Cancelled{x}', exit_code: 1) unless res
|
316
320
|
|
317
321
|
basename = File.basename(target, ".#{NA.extension}")
|
318
|
-
NA.create_todo(target, basename)
|
322
|
+
NA.create_todo(target, basename, template: global_options[:template])
|
319
323
|
end
|
320
324
|
|
321
325
|
end
|
@@ -326,7 +330,7 @@ class App
|
|
326
330
|
if res
|
327
331
|
basename = File.expand_path('.').split('/').last
|
328
332
|
target = "#{basename}.#{NA.extension}"
|
329
|
-
NA.create_todo(target, basename)
|
333
|
+
NA.create_todo(target, basename, template: global_options[:template])
|
330
334
|
files = NA.find_files(depth: 1)
|
331
335
|
end
|
332
336
|
end
|
@@ -619,10 +623,12 @@ class App
|
|
619
623
|
|
620
624
|
desc 'Find actions matching a search pattern'
|
621
625
|
long_desc 'Search tokens are separated by spaces. Actions matching all tokens in the pattern will be shown
|
622
|
-
(partial matches allowed). Add a + before a token to make it required, e.g. `na find +feature +maybe
|
626
|
+
(partial matches allowed). Add a + before a token to make it required, e.g. `na find +feature +maybe`,
|
627
|
+
add a - or ! to ignore matches containing that token.'
|
623
628
|
arg_name 'PATTERN'
|
624
629
|
command %i[find grep] do |c|
|
625
630
|
c.example 'na find feature idea swift', desc: 'Find all actions containing feature, idea, and swift'
|
631
|
+
c.example 'na find feature idea -swift', desc: 'Find all actions containing feature and idea but NOT swift'
|
626
632
|
c.example 'na find -x feature idea', desc: 'Find all actions containing the exact text "feature idea"'
|
627
633
|
|
628
634
|
c.desc 'Interpret search pattern as regular expression'
|
@@ -900,7 +906,7 @@ class App
|
|
900
906
|
c.example 'na init', desc: 'Generate a new todo file, prompting for project name'
|
901
907
|
c.example 'na init warpspeed', desc: 'Generate a new todo for a project called warpspeed'
|
902
908
|
|
903
|
-
c.action do |
|
909
|
+
c.action do |global_options, _options, args|
|
904
910
|
reader = TTY::Reader.new
|
905
911
|
if args.count.positive?
|
906
912
|
project = args.join(' ')
|
@@ -917,7 +923,7 @@ class App
|
|
917
923
|
|
918
924
|
end
|
919
925
|
|
920
|
-
NA.create_todo(target, project)
|
926
|
+
NA.create_todo(target, project, template: global_options[:template])
|
921
927
|
end
|
922
928
|
end
|
923
929
|
|
@@ -1098,7 +1104,7 @@ class App
|
|
1098
1104
|
c.example 'na tagged "+maybe,+priority<=3" --save maybelater', description: 'save a search called "maybelater"'
|
1099
1105
|
c.example 'na saved maybelater', description: 'perform the search named "maybelater"'
|
1100
1106
|
c.example 'na saved maybe',
|
1101
|
-
description: 'perform the search named "maybelater", assuming no other searches match "
|
1107
|
+
description: 'perform the search named "maybelater", assuming no other searches match "maybe"'
|
1102
1108
|
c.example 'na maybe',
|
1103
1109
|
description: 'na run with no command and a single argument automatically performs a matching saved search'
|
1104
1110
|
c.example 'na saved', description: 'list available searches'
|
data/lib/na/action.rb
CHANGED
data/lib/na/colors.rb
CHANGED
data/lib/na/next_action.rb
CHANGED
@@ -72,21 +72,25 @@ module NA
|
|
72
72
|
## @param target [String] The target path
|
73
73
|
## @param basename [String] The project base name
|
74
74
|
##
|
75
|
-
def create_todo(target, basename)
|
75
|
+
def create_todo(target, basename, template: nil)
|
76
76
|
File.open(target, 'w') do |f|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
77
|
+
if template && File.exist?(template)
|
78
|
+
content = IO.read(template)
|
79
|
+
else
|
80
|
+
content = <<~ENDCONTENT
|
81
|
+
Inbox:
|
82
|
+
#{basename}:
|
83
|
+
\tFeature Requests:
|
84
|
+
\tIdeas:
|
85
|
+
\tBugs:
|
86
|
+
Archive:
|
87
|
+
Search Definitions:
|
88
|
+
\tTop Priority @search(@priority = 5 and not @done)
|
89
|
+
\tHigh Priority @search(@priority > 3 and not @done)
|
90
|
+
\tMaybe @search(@maybe)
|
91
|
+
\tNext @search(@#{NA.na_tag} and not @done and not project = \"Archive\")
|
92
|
+
ENDCONTENT
|
93
|
+
end
|
90
94
|
f.puts(content)
|
91
95
|
end
|
92
96
|
save_working_dir(target)
|
@@ -600,7 +604,6 @@ module NA
|
|
600
604
|
content = file.read_file
|
601
605
|
indent_level = 0
|
602
606
|
parent = []
|
603
|
-
last_line = 0
|
604
607
|
in_action = false
|
605
608
|
content.split("\n").each.with_index do |line, idx|
|
606
609
|
if line.project?
|
data/lib/na/version.rb
CHANGED
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.
|
12
|
+
The current version of `na` is <!--VER-->1.2.22<!--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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: na
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
246
246
|
- !ruby/object:Gem::Version
|
247
247
|
version: '0'
|
248
248
|
requirements: []
|
249
|
-
rubygems_version: 3.2.
|
249
|
+
rubygems_version: 3.2.15
|
250
250
|
signing_key:
|
251
251
|
specification_version: 4
|
252
252
|
summary: A command line tool for adding and listing project todos
|