na 1.0.3 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/Gemfile.lock +1 -1
- data/README.md +59 -15
- data/bin/na +100 -32
- data/lib/na/action.rb +10 -3
- data/lib/na/next_action.rb +66 -23
- data/lib/na/version.rb +1 -1
- data/scripts/fixreadme.rb +1 -1
- data/src/README.md +59 -15
- 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: 92a40acdde96bfe4a27a093edf4e0f909b23b1c300d6be4f742323ac4e9233be
|
4
|
+
data.tar.gz: bfddb6edfe9cddf7a631819bd980708fd816d2853b3146f348c2095b1ca7aee2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77fd24c44ea1b7dba5fb2feb8d36e625972b7662c3032d96ffb7af28843cc08ad16f911fb58778b7cfc831b329859effb04134168517eb596f1da4e9d62cc001
|
7
|
+
data.tar.gz: 212c87e2f59706bd6ed9b5e4cec2ecbd629e9b344a7538f653d8b278dd0f9e62aeb2ceada2d2ed8ef12421fc8c54396ec6e2462b77fe28f90d90946a6aed3967
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,26 @@
|
|
1
|
+
### 1.0.5
|
2
|
+
|
3
|
+
2022-09-28 01:53
|
4
|
+
|
5
|
+
#### FIXED
|
6
|
+
|
7
|
+
- A note containing a colon would be recognized as a project line
|
8
|
+
|
9
|
+
### 1.0.4
|
10
|
+
|
11
|
+
2022-09-28 01:18
|
12
|
+
|
13
|
+
#### NEW
|
14
|
+
|
15
|
+
- OS agnostic command to open todo file in an editor
|
16
|
+
- `na init` command to generate a new todo file
|
17
|
+
|
18
|
+
#### IMPROVED
|
19
|
+
|
20
|
+
- Output formatting
|
21
|
+
- Make directory matching fuzzy for `na next`
|
22
|
+
- --verbose global switch to output debug info
|
23
|
+
|
1
24
|
### 1.0.3
|
2
25
|
|
3
26
|
2022-09-27 14:30
|
data/Gemfile.lock
CHANGED
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.0.
|
12
|
+
The current version of `na` is 1.0.4.
|
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
|
|
@@ -49,15 +49,11 @@ If you don't have Ruby/RubyGems, you can install them pretty easily with Homebre
|
|
49
49
|
NAME
|
50
50
|
na - Add and list next actions for the current project
|
51
51
|
|
52
|
-
|
53
52
|
SYNOPSIS
|
54
53
|
na [global options] command [command options] [arguments...]
|
55
54
|
|
56
|
-
|
57
55
|
VERSION
|
58
|
-
1.0.
|
59
|
-
|
60
|
-
|
56
|
+
1.0.4
|
61
57
|
|
62
58
|
GLOBAL OPTIONS
|
63
59
|
-a, --[no-]add - Add a next action (deprecated, for backwards compatibility)
|
@@ -67,18 +63,19 @@ GLOBAL OPTIONS
|
|
67
63
|
-n, --[no-]note - Prompt for additional notes (deprecated, for backwards compatibility)
|
68
64
|
--na_tag=TAG - Tag to consider a next action (default: na)
|
69
65
|
-p, --priority=PRIORITY - Set a priority 0-5 (deprecated, for backwards compatibility) (default: none)
|
70
|
-
-r, --[no-]recurse - Recurse 3 directories deep (deprecated, for backwards compatability)
|
66
|
+
-r, --[no-]recurse - Recurse 3 directories deep (deprecated, for backwards compatability) (default: enabled)
|
67
|
+
--[no-]verbose - Display verbose output
|
71
68
|
--version - Display the program version
|
72
69
|
|
73
|
-
|
74
|
-
|
75
70
|
COMMANDS
|
76
|
-
add
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
71
|
+
add - Add a new next action
|
72
|
+
edit - Open a todo file in the default editor
|
73
|
+
find - Find actions matching a search pattern
|
74
|
+
help - Shows a list of commands or help for one command
|
75
|
+
init, create - Create a new todo file in the current directory
|
76
|
+
initconfig - Initialize the config file using current global options
|
77
|
+
next, show - Show next actions
|
78
|
+
tagged - Find actions matching a tag
|
82
79
|
```
|
83
80
|
|
84
81
|
#### Commands
|
@@ -113,6 +110,34 @@ EXAMPLES
|
|
113
110
|
na add "A bug I need to fix" -p 4 -n
|
114
111
|
```
|
115
112
|
|
113
|
+
##### edit
|
114
|
+
|
115
|
+
```
|
116
|
+
NAME
|
117
|
+
edit - Open a todo file in the default editor
|
118
|
+
|
119
|
+
SYNOPSIS
|
120
|
+
|
121
|
+
na [global options] edit [command options]
|
122
|
+
|
123
|
+
DESCRIPTION
|
124
|
+
Let the system choose the defualt, (e.g. TaskPaper), or specify a command line utility (e.g. vim). If more than one todo file is found, a menu is displayed.
|
125
|
+
|
126
|
+
COMMAND OPTIONS
|
127
|
+
-a, --app=EDITOR - Specify a Mac app (default: none)
|
128
|
+
-d, --depth=DEPTH - Recurse to depth (default: 1)
|
129
|
+
-e, --editor=EDITOR - Specify an editor CLI (default: none)
|
130
|
+
|
131
|
+
EXAMPLES
|
132
|
+
|
133
|
+
# Open the main todo file in the default editor
|
134
|
+
na edit
|
135
|
+
|
136
|
+
# Display a menu of all todo files three levels deep from the
|
137
|
+
current directory, open selection in vim.
|
138
|
+
na edit -d 3 -a vim
|
139
|
+
```
|
140
|
+
|
116
141
|
##### find
|
117
142
|
|
118
143
|
Example: `na find cool feature idea`
|
@@ -144,6 +169,25 @@ EXAMPLES
|
|
144
169
|
na find -d 3 swift obj-c
|
145
170
|
```
|
146
171
|
|
172
|
+
##### init, create
|
173
|
+
|
174
|
+
```
|
175
|
+
NAME
|
176
|
+
init - Create a new todo file in the current directory
|
177
|
+
|
178
|
+
SYNOPSIS
|
179
|
+
|
180
|
+
na [global options] init [PROJECT]
|
181
|
+
|
182
|
+
EXAMPLES
|
183
|
+
|
184
|
+
# Generate a new todo file, prompting for project name
|
185
|
+
na init
|
186
|
+
|
187
|
+
# Generate a new todo for a project called warpspeed
|
188
|
+
na init warpspeed
|
189
|
+
```
|
190
|
+
|
147
191
|
##### next, show
|
148
192
|
|
149
193
|
Examples:
|
data/bin/na
CHANGED
@@ -47,12 +47,15 @@ class App
|
|
47
47
|
default_value 1
|
48
48
|
flag %i[d depth], type: :integer, must_match: /^\d+$/
|
49
49
|
|
50
|
+
desc 'Display verbose output'
|
51
|
+
switch %i[verbose]
|
52
|
+
|
50
53
|
desc 'Show next actions'
|
51
54
|
arg_name 'OPTIONAL_QUERY'
|
52
55
|
command %i[next show] do |c|
|
53
56
|
c.example 'doing next', desc: 'display the next actions from any todo files in the current directory'
|
54
|
-
c.example 'doing next -d 3', desc: 'display the next actions from the current directory
|
55
|
-
|
57
|
+
c.example 'doing next -d 3', desc: 'display the next actions from the current directory, traversing 3 levels deep'
|
58
|
+
c.example 'doing next marked', desc: 'display next actions for a project you visited in the past'
|
56
59
|
c.desc 'Recurse to depth'
|
57
60
|
c.arg_name 'DEPTH'
|
58
61
|
c.flag %i[d depth], type: :integer, must_match: /^\d+$/
|
@@ -71,6 +74,11 @@ class App
|
|
71
74
|
exit run(cmd)
|
72
75
|
end
|
73
76
|
|
77
|
+
depth = if global_options[:recurse] && options[:depth].nil? && global_options[:depth] == 1
|
78
|
+
3
|
79
|
+
else
|
80
|
+
options[:depth].nil? ? global_options[:depth].to_i : options[:depth].to_i
|
81
|
+
end
|
74
82
|
|
75
83
|
if args.count.positive?
|
76
84
|
tokens = []
|
@@ -83,19 +91,14 @@ class App
|
|
83
91
|
end
|
84
92
|
end
|
85
93
|
|
86
|
-
depth = if global_options[:recurse] && options[:depth].nil? && global_options[:depth] == 1
|
87
|
-
3
|
88
|
-
else
|
89
|
-
options[:depth].nil? ? global_options[:depth].to_i : options[:depth].to_i
|
90
|
-
end
|
91
94
|
tag = options[:tag] == global_options[:na_tag] ? nil : options[:tag]
|
92
|
-
actions = NA.parse_actions(depth: depth,
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
95
|
+
files, actions = NA.parse_actions(depth: depth,
|
96
|
+
query: tokens,
|
97
|
+
extension: global_options[:ext],
|
98
|
+
na_tag: global_options[:na_tag],
|
99
|
+
tag: tag)
|
97
100
|
|
98
|
-
NA.output_actions(actions, depth, global_options[:ext])
|
101
|
+
NA.output_actions(actions, depth, global_options[:ext], files: files)
|
99
102
|
end
|
100
103
|
end
|
101
104
|
|
@@ -232,23 +235,23 @@ class App
|
|
232
235
|
end
|
233
236
|
end
|
234
237
|
|
235
|
-
actions = NA.parse_actions(depth: depth,
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
NA.output_actions(actions, depth, global_options[:ext])
|
238
|
+
files, actions = NA.parse_actions(depth: depth,
|
239
|
+
extension: global_options[:ext],
|
240
|
+
na_tag: global_options[:na_tag],
|
241
|
+
search: tokens)
|
242
|
+
NA.output_actions(actions, depth, global_options[:ext], files: files)
|
240
243
|
end
|
241
244
|
end
|
242
245
|
|
243
246
|
|
244
247
|
desc 'Find actions matching a tag'
|
245
248
|
long_desc 'Finds actions with tags matching the arguments. An action is shown if it
|
246
|
-
contains any of the tags listed. Add a + before a tag to make it required
|
247
|
-
e.g. `na tagged feature +maybe`'
|
249
|
+
contains any of the tags listed. Add a + before a tag to make it required. You can specify values using TAG=VALUE pairs.'
|
248
250
|
arg_name 'TAG [VALUE]'
|
249
251
|
command %i[tagged] do |c|
|
250
252
|
c.example 'na tagged +maybe', desc: 'Show all actions tagged @maybe'
|
251
253
|
c.example 'na tagged -d 3 feature idea', desc: 'Show all actions tagged either @feature or @idea, recurse 3 levels'
|
254
|
+
c.example 'na tagged +priority=5', desc: 'Show actions with @priority(5)'
|
252
255
|
|
253
256
|
c.desc 'Recurse to depth'
|
254
257
|
c.arg_name 'DEPTH'
|
@@ -274,24 +277,89 @@ class App
|
|
274
277
|
})
|
275
278
|
end
|
276
279
|
|
277
|
-
actions = NA.parse_actions(depth: depth,
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
NA.output_actions(actions, depth, global_options[:ext])
|
280
|
+
files, actions = NA.parse_actions(depth: depth,
|
281
|
+
extension: global_options[:ext],
|
282
|
+
na_tag: global_options[:na_tag],
|
283
|
+
tag: tags)
|
284
|
+
NA.output_actions(actions, depth, global_options[:ext], files: files)
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
288
|
+
desc 'Create a new todo file in the current directory'
|
289
|
+
arg_name '[PROJECT]'
|
290
|
+
command %i[init create] do |c|
|
291
|
+
c.example 'na init', desc: 'Generate a new todo file, prompting for project name'
|
292
|
+
c.example 'na init warpspeed', desc: 'Generate a new todo for a project called warpspeed'
|
293
|
+
|
294
|
+
c.action do |global_options, _, args|
|
295
|
+
reader = TTY::Reader.new
|
296
|
+
if args.count.positive?
|
297
|
+
project = args.join(' ')
|
298
|
+
else
|
299
|
+
project = File.expand_path('.').split('/').last
|
300
|
+
project = reader.read_line(NA::Color.template('{y}Project name {bw}> {x}'), value: project).strip
|
301
|
+
end
|
302
|
+
|
303
|
+
target = "#{project}.#{global_options[:ext]}"
|
304
|
+
|
305
|
+
if File.exist?(target)
|
306
|
+
print NA::Color.template("{r}File {bw}#{target}{r} already exists, overwrite it? {br}y{w}/{bg}N{x} ")
|
307
|
+
res = reader.read_char
|
308
|
+
Process.exit 1 unless res =~ /y/i
|
309
|
+
end
|
310
|
+
|
311
|
+
NA.create_todo(target, project)
|
312
|
+
end
|
313
|
+
end
|
314
|
+
|
315
|
+
desc 'Open a todo file in the default editor'
|
316
|
+
long_desc 'Let the system choose the defualt, (e.g. TaskPaper), or specify a command line utility (e.g. vim).
|
317
|
+
If more than one todo file is found, a menu is displayed.'
|
318
|
+
command %i[edit] do |c|
|
319
|
+
c.example 'na edit', desc: 'Open the main todo file in the default editor'
|
320
|
+
c.example 'na edit -d 3 -a vim', desc: 'Display a menu of all todo files three levels deep from the
|
321
|
+
current directory, open selection in vim.'
|
322
|
+
|
323
|
+
c.desc 'Recurse to depth'
|
324
|
+
c.arg_name 'DEPTH'
|
325
|
+
c.default_value 1
|
326
|
+
c.flag %i[d depth], type: :integer, must_match: /^\d+$/
|
327
|
+
|
328
|
+
c.desc 'Specify an editor CLI'
|
329
|
+
c.arg_name 'EDITOR'
|
330
|
+
c.flag %i[e editor]
|
331
|
+
|
332
|
+
c.desc 'Specify a Mac app'
|
333
|
+
c.arg_name 'EDITOR'
|
334
|
+
c.flag %i[a app]
|
335
|
+
|
336
|
+
c.action do |global_options, options, args|
|
337
|
+
depth = if global_options[:recurse] && options[:depth].nil? && global_options[:depth] == 1
|
338
|
+
3
|
339
|
+
else
|
340
|
+
options[:depth].nil? ? global_options[:depth].to_i : options[:depth].to_i
|
341
|
+
end
|
342
|
+
files = NA.find_files(depth: depth, extension: global_options[:ext])
|
343
|
+
file = if files.count > 1
|
344
|
+
NA.select_file(files)
|
345
|
+
else
|
346
|
+
files[0]
|
347
|
+
end
|
348
|
+
|
349
|
+
if options[:editor]
|
350
|
+
system %(#{options[:editor]} "#{file}")
|
351
|
+
else
|
352
|
+
NA.edit_file(file: file, app: options[:app])
|
353
|
+
end
|
282
354
|
end
|
283
355
|
end
|
284
356
|
|
285
|
-
pre do |global,command,options,args|
|
286
|
-
|
287
|
-
# Return true to proceed; false to abort and not call the
|
288
|
-
# chosen command
|
289
|
-
# Use skips_pre before a command to skip this block
|
290
|
-
# on that command only
|
357
|
+
pre do |global, command, options, args|
|
358
|
+
NA.verbose = global[:verbose]
|
291
359
|
true
|
292
360
|
end
|
293
361
|
|
294
|
-
post do |global,command,options,args|
|
362
|
+
post do |global, command, options, args|
|
295
363
|
# Post logic here
|
296
364
|
# Use skips_post before a command to skip this
|
297
365
|
# block on that command only
|
data/lib/na/action.rb
CHANGED
@@ -44,17 +44,24 @@ module NA
|
|
44
44
|
parents = @parent.map do |par|
|
45
45
|
NA::Color.template("#{template[:parent]}#{par}")
|
46
46
|
end.join(NA::Color.template(template[:parent_divider]))
|
47
|
-
parents = "#{parents} "
|
47
|
+
parents = "{dc}[{x}#{parents}{dc}]{x} "
|
48
48
|
else
|
49
49
|
parents = ''
|
50
50
|
end
|
51
51
|
|
52
52
|
project = NA::Color.template("#{template[:project]}#{@project}{x} ")
|
53
53
|
|
54
|
-
|
54
|
+
file = @file.sub(%r{^\./}, '').sub(/#{ENV['HOME']}/, '~')
|
55
|
+
file = file.sub(/\.#{extension}$/, '')
|
56
|
+
file = file.sub(/#{File.basename(@file, ".#{extension}")}$/, "{dw}#{File.basename(@file, ".#{extension}")}{x}")
|
57
|
+
file_tpl = "#{template[:file]}#{file} {x}"
|
58
|
+
filename = NA::Color.template(file_tpl)
|
55
59
|
|
56
60
|
action = NA::Color.template("#{template[:action]}#{@action}{x}")
|
57
|
-
action = action.highlight_tags(color: template[:tags],
|
61
|
+
action = action.highlight_tags(color: template[:tags],
|
62
|
+
parens: template[:value_parens],
|
63
|
+
value: template[:values],
|
64
|
+
last_color: template[:action])
|
58
65
|
|
59
66
|
NA::Color.template(template[:output].gsub(/%filename/, filename)
|
60
67
|
.gsub(/%project/, project)
|
data/lib/na/next_action.rb
CHANGED
@@ -3,20 +3,22 @@
|
|
3
3
|
# Next Action methods
|
4
4
|
module NA
|
5
5
|
class << self
|
6
|
+
attr_accessor :verbose
|
7
|
+
|
6
8
|
def create_todo(target, basename)
|
7
9
|
File.open(target, 'w') do |f|
|
8
10
|
content = <<~ENDCONTENT
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
11
|
+
Inbox: @inbox
|
12
|
+
#{basename}:
|
13
|
+
\tFeature Requests:
|
14
|
+
\tIdeas:
|
15
|
+
\tBugs:
|
16
|
+
Archive:
|
17
|
+
Search Definitions:
|
18
|
+
\tTop Priority @search(@priority = 5 and not @done)
|
19
|
+
\tHigh Priority @search(@priority > 3 and not @done)
|
20
|
+
\tMaybe @search(@maybe)
|
21
|
+
\tNext @search(@na and not @done and not project = \"Archive\")
|
20
22
|
ENDCONTENT
|
21
23
|
f.puts(content)
|
22
24
|
end
|
@@ -70,8 +72,14 @@ module NA
|
|
70
72
|
puts NA::Color.template("{by}Task added to {bw}#{file}{x}")
|
71
73
|
end
|
72
74
|
|
73
|
-
def output_actions(actions, depth, extension)
|
74
|
-
template = if
|
75
|
+
def output_actions(actions, depth, extension, files: nil)
|
76
|
+
template = if files&.count.positive?
|
77
|
+
if files.count == 1
|
78
|
+
'%parent%action'
|
79
|
+
else
|
80
|
+
'%filename%parent%action'
|
81
|
+
end
|
82
|
+
elsif NA.find_files(depth: depth, extension: extension).count > 1
|
75
83
|
if depth > 1
|
76
84
|
'%filename%parent%action'
|
77
85
|
else
|
@@ -80,6 +88,10 @@ module NA
|
|
80
88
|
else
|
81
89
|
'%parent%action'
|
82
90
|
end
|
91
|
+
if files && @verbose
|
92
|
+
puts files.map { |f| NA::Color.template("{dw}#{f}{x}") }
|
93
|
+
end
|
94
|
+
|
83
95
|
puts actions.map { |action| action.pretty(template: { output: template }) }
|
84
96
|
end
|
85
97
|
|
@@ -125,7 +137,7 @@ module NA
|
|
125
137
|
parent = []
|
126
138
|
content.split("\n").each do |line|
|
127
139
|
new_action = nil
|
128
|
-
if line =~ /([ \t]*)([^\-]+.*?)
|
140
|
+
if line =~ /([ \t]*)([^\-]+.*?): *(@\S+ *)*$/
|
129
141
|
proj = Regexp.last_match(2)
|
130
142
|
indent = line.indent_level
|
131
143
|
|
@@ -150,7 +162,7 @@ module NA
|
|
150
162
|
end
|
151
163
|
end
|
152
164
|
end
|
153
|
-
actions
|
165
|
+
[files, actions]
|
154
166
|
end
|
155
167
|
|
156
168
|
##
|
@@ -184,20 +196,25 @@ module NA
|
|
184
196
|
res
|
185
197
|
end
|
186
198
|
|
199
|
+
def database_path
|
200
|
+
db_dir = File.expand_path('~/.local/share/na')
|
201
|
+
FileUtils.mkdir_p(db_dir) unless File.directory?(db_dir)
|
202
|
+
db_file = 'tdlist.txt'
|
203
|
+
File.join(db_dir, db_file)
|
204
|
+
end
|
205
|
+
|
187
206
|
def match_working_dir(search)
|
188
207
|
optional = []
|
189
208
|
required = []
|
190
209
|
|
191
210
|
search&.each do |t|
|
192
|
-
new_rx = t[:token].to_s
|
211
|
+
new_rx = t[:token].to_s.split('').join('.{0,1}')
|
193
212
|
|
194
213
|
optional.push(new_rx)
|
195
214
|
required.push(new_rx) if t[:required]
|
196
215
|
end
|
197
216
|
|
198
|
-
|
199
|
-
db_file = 'tdlist.txt'
|
200
|
-
file = File.join(db_dir, db_file)
|
217
|
+
file = database_path
|
201
218
|
if File.exist?(file)
|
202
219
|
dirs = IO.read(file).split("\n")
|
203
220
|
dirs.delete_if { |d| !d.matches(any: optional, all: required) }
|
@@ -209,10 +226,7 @@ module NA
|
|
209
226
|
end
|
210
227
|
|
211
228
|
def save_working_dir(todo_file)
|
212
|
-
|
213
|
-
FileUtils.mkdir_p(db_dir) unless File.directory?(db_dir)
|
214
|
-
db_file = 'tdlist.txt'
|
215
|
-
file = File.join(db_dir, db_file)
|
229
|
+
file = database_path
|
216
230
|
content = File.exist?(file) ? IO.read(file) : ''
|
217
231
|
dirs = content.split(/\n/)
|
218
232
|
dirs.push(File.expand_path(todo_file))
|
@@ -230,5 +244,34 @@ module NA
|
|
230
244
|
File.open(file, 'w') { |f| f.puts dirs.join("\n") }
|
231
245
|
end
|
232
246
|
end
|
247
|
+
|
248
|
+
def edit_file(file: nil, app: nil)
|
249
|
+
os_open(file, app: app) if file && File.exist?(file)
|
250
|
+
end
|
251
|
+
|
252
|
+
##
|
253
|
+
## Platform-agnostic open command
|
254
|
+
##
|
255
|
+
## @param file [String] The file to open
|
256
|
+
##
|
257
|
+
def os_open(file, app: nil)
|
258
|
+
os = RbConfig::CONFIG['target_os']
|
259
|
+
case os
|
260
|
+
when /darwin.*/i
|
261
|
+
if app
|
262
|
+
`open -a "#{app}" #{Shellwords.escape(file)}`
|
263
|
+
else
|
264
|
+
`open #{Shellwords.escape(file)}`
|
265
|
+
end
|
266
|
+
when /mingw|mswin/i
|
267
|
+
`start #{Shellwords.escape(file)}`
|
268
|
+
else
|
269
|
+
if 'xdg-open'.available?
|
270
|
+
`xdg-open #{Shellwords.escape(file)}`
|
271
|
+
else
|
272
|
+
puts NA::Color.template('{r}Unable to determine executable for `open`.{x}')
|
273
|
+
end
|
274
|
+
end
|
275
|
+
end
|
233
276
|
end
|
234
277
|
end
|
data/lib/na/version.rb
CHANGED
data/scripts/fixreadme.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.0.
|
12
|
+
The current version of `na` is <!--VER-->1.0.4<!--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
|
|
@@ -49,15 +49,11 @@ If you don't have Ruby/RubyGems, you can install them pretty easily with Homebre
|
|
49
49
|
NAME
|
50
50
|
na - Add and list next actions for the current project
|
51
51
|
|
52
|
-
|
53
52
|
SYNOPSIS
|
54
53
|
na [global options] command [command options] [arguments...]
|
55
54
|
|
56
|
-
|
57
55
|
VERSION
|
58
|
-
1.0.
|
59
|
-
|
60
|
-
|
56
|
+
1.0.4
|
61
57
|
|
62
58
|
GLOBAL OPTIONS
|
63
59
|
-a, --[no-]add - Add a next action (deprecated, for backwards compatibility)
|
@@ -67,18 +63,19 @@ GLOBAL OPTIONS
|
|
67
63
|
-n, --[no-]note - Prompt for additional notes (deprecated, for backwards compatibility)
|
68
64
|
--na_tag=TAG - Tag to consider a next action (default: na)
|
69
65
|
-p, --priority=PRIORITY - Set a priority 0-5 (deprecated, for backwards compatibility) (default: none)
|
70
|
-
-r, --[no-]recurse - Recurse 3 directories deep (deprecated, for backwards compatability)
|
66
|
+
-r, --[no-]recurse - Recurse 3 directories deep (deprecated, for backwards compatability) (default: enabled)
|
67
|
+
--[no-]verbose - Display verbose output
|
71
68
|
--version - Display the program version
|
72
69
|
|
73
|
-
|
74
|
-
|
75
70
|
COMMANDS
|
76
|
-
add
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
71
|
+
add - Add a new next action
|
72
|
+
edit - Open a todo file in the default editor
|
73
|
+
find - Find actions matching a search pattern
|
74
|
+
help - Shows a list of commands or help for one command
|
75
|
+
init, create - Create a new todo file in the current directory
|
76
|
+
initconfig - Initialize the config file using current global options
|
77
|
+
next, show - Show next actions
|
78
|
+
tagged - Find actions matching a tag
|
82
79
|
```
|
83
80
|
|
84
81
|
#### Commands
|
@@ -113,6 +110,34 @@ EXAMPLES
|
|
113
110
|
na add "A bug I need to fix" -p 4 -n
|
114
111
|
```
|
115
112
|
|
113
|
+
##### edit
|
114
|
+
|
115
|
+
```
|
116
|
+
NAME
|
117
|
+
edit - Open a todo file in the default editor
|
118
|
+
|
119
|
+
SYNOPSIS
|
120
|
+
|
121
|
+
na [global options] edit [command options]
|
122
|
+
|
123
|
+
DESCRIPTION
|
124
|
+
Let the system choose the defualt, (e.g. TaskPaper), or specify a command line utility (e.g. vim). If more than one todo file is found, a menu is displayed.
|
125
|
+
|
126
|
+
COMMAND OPTIONS
|
127
|
+
-a, --app=EDITOR - Specify a Mac app (default: none)
|
128
|
+
-d, --depth=DEPTH - Recurse to depth (default: 1)
|
129
|
+
-e, --editor=EDITOR - Specify an editor CLI (default: none)
|
130
|
+
|
131
|
+
EXAMPLES
|
132
|
+
|
133
|
+
# Open the main todo file in the default editor
|
134
|
+
na edit
|
135
|
+
|
136
|
+
# Display a menu of all todo files three levels deep from the
|
137
|
+
current directory, open selection in vim.
|
138
|
+
na edit -d 3 -a vim
|
139
|
+
```
|
140
|
+
|
116
141
|
##### find
|
117
142
|
|
118
143
|
Example: `na find cool feature idea`
|
@@ -144,6 +169,25 @@ EXAMPLES
|
|
144
169
|
na find -d 3 swift obj-c
|
145
170
|
```
|
146
171
|
|
172
|
+
##### init, create
|
173
|
+
|
174
|
+
```
|
175
|
+
NAME
|
176
|
+
init - Create a new todo file in the current directory
|
177
|
+
|
178
|
+
SYNOPSIS
|
179
|
+
|
180
|
+
na [global options] init [PROJECT]
|
181
|
+
|
182
|
+
EXAMPLES
|
183
|
+
|
184
|
+
# Generate a new todo file, prompting for project name
|
185
|
+
na init
|
186
|
+
|
187
|
+
# Generate a new todo for a project called warpspeed
|
188
|
+
na init warpspeed
|
189
|
+
```
|
190
|
+
|
147
191
|
##### next, show
|
148
192
|
|
149
193
|
Examples:
|
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.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|