na 1.0.2 → 1.0.4

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: 17064787b8afa01f88d01971b93f9f28593f40666ff8c2d49ecd52dff678654c
4
- data.tar.gz: f14105b3e652e320b91022a6d4fb6c8cafc0811e6bbc5f7a0888b915e1ba1f99
3
+ metadata.gz: f9da419b49e24864d0adfc81fa3834c8920d482de91597124b3640b14d5fb0e6
4
+ data.tar.gz: ed6cb25a6889ff354baef255e7abeeb6a8ff13aee6907f84af5078c4aaee9954
5
5
  SHA512:
6
- metadata.gz: e01fa0fc9027be241d59414d555661df5f1794db2b30fa969562f7db08f22ae1abcd4289f69178a839cb18f4077213b3ae4ee106a776325016633af9f4c6cf12
7
- data.tar.gz: a13918d2f66aba2b5d84622e33bb60d9404c0795b5ad6c0badcee1ea3e6fe523168d8bdcb46bc45b2fb15df7a62cc54e5f630c9f7c01929982b09fc25b60da79
6
+ metadata.gz: 6e4c30403c700644291354a66cc542eb98545c429a843119083b2251535df823fce89f8b218e4fb8a778e6f07dac8b5d562a09df0c75569383798b5659489082
7
+ data.tar.gz: 59bee0616ecfa10cf204028776538cd0ec4cb268a5a903a3f16558a84b464824cd09c848098b5767c48e8c8e7d53273fd79773487857a5c18b0e7ee6e84461b9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ### 1.0.4
2
+
3
+ 2022-09-28 01:18
4
+
5
+ #### NEW
6
+
7
+ - OS agnostic command to open todo file in an editor
8
+ - `na init` command to generate a new todo file
9
+
10
+ #### IMPROVED
11
+
12
+ - Output formatting
13
+ - Make directory matching fuzzy for `na next`
14
+ - --verbose global switch to output debug info
15
+
16
+ ### 1.0.3
17
+
18
+ 2022-09-27 14:30
19
+
20
+ #### FIXED
21
+
22
+ - Running `na -a -n` yielded an error
23
+
1
24
  ### 1.0.2
2
25
 
3
26
  2022-09-27 14:18
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.0.2)
4
+ na (1.0.4)
5
5
  gli (~> 2.21.0)
6
6
  tty-reader (~> 0.9, >= 0.9.0)
7
7
  tty-screen (~> 0.8, >= 0.8.1)
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.1.
12
+ The current version of `na` is 1.0.3.
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.2
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 - Add a new next action
77
- find - Find actions matching a search pattern
78
- help - Shows a list of commands or help for one command
79
- initconfig - Initialize the config file using current global options
80
- next, show - Show next actions
81
- tagged - Find actions matching a tag
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 and its children, 3 levels deep'
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+$/
@@ -66,11 +69,16 @@ class App
66
69
  cmd = ['add']
67
70
  cmd.push('--note') if global_options[:note]
68
71
  cmd.concat(['--priority', global_options[:priority]]) if global_options[:priority]
69
- cmd.push(ARGV.unshift($first_arg)) if ARGV.count.positive?
72
+ cmd.push(ARGV.unshift($first_arg)) if ARGV.count > 2
70
73
 
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
- query: tokens,
94
- extension: global_options[:ext],
95
- na_tag: global_options[:na_tag],
96
- tag: tag)
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
- extension: global_options[:ext],
237
- na_tag: global_options[:na_tag],
238
- search: tokens)
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
- extension: global_options[:ext],
279
- na_tag: global_options[:na_tag],
280
- tag: tags)
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
- # Pre logic here
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
- filename = NA::Color.template("#{template[:file]}#{@file.sub(/^\.\//, '').sub(/\.#{extension}$/, '')} {x}")
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], parens: template[:value_parens], value: template[:values], last_color: template[:action])
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)
@@ -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
- Inbox: @inbox
10
- #{basename}:
11
- \tNew Features:
12
- \tIdeas:
13
- \tBugs:
14
- Archive:
15
- Search Definitions:
16
- \tTop Priority @search(@priority = 5 and not @done)
17
- \tHigh Priority @search(@priority > 3 and not @done)
18
- \tMaybe @search(@maybe)
19
- \tNext @search(@na and not @done and not project = \"Archive\")
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 NA.find_files(depth: depth, extension: extension).count > 1
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
 
@@ -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
- db_dir = File.expand_path('~/.local/share/na')
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
- db_dir = File.expand_path('~/.local/share/na')
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
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.4'
3
3
  end
data/scripts/fixreadme.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- current_ver = ARGV[0]
4
+ current_ver = `git ver`
5
5
  src = 'src/README.md'
6
6
  dest = 'README.md'
7
7
 
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.1<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.0.3<!--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.2
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 - Add a new next action
77
- find - Find actions matching a search pattern
78
- help - Shows a list of commands or help for one command
79
- initconfig - Initialize the config file using current global options
80
- next, show - Show next actions
81
- tagged - Find actions matching a tag
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.2
4
+ version: 1.0.4
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-27 00:00:00.000000000 Z
11
+ date: 2022-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake