na 1.2.25 → 1.2.26

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: fb2c991e3e916c35ac9820504725f1e8b41f0030c0f87a0672ec4cfcc5190c09
4
- data.tar.gz: 97de5c78cf2ce7f53a6268030b9c0fb5d4881c7f40e312d289207353fc53801a
3
+ metadata.gz: 890425bc1defde99d8f672fb531b736a6d4018487200c8e18ef5914478332144
4
+ data.tar.gz: ad8d9e5105f55080571e37a906fc1e3bdee3559c13898d1a4dcd706862405bc7
5
5
  SHA512:
6
- metadata.gz: 74a6012339df8e359f39942c481905de44c066a1d0c464ce942de7590d23a80da3fe68b79f86215faeaa5efc831e3b88f96630b51ca2285967afbd9b24956e07
7
- data.tar.gz: 134d9db7430525d873025c23b00bd57c2494038a8af9e4bb48d1544f39e804b065313ad4f542ebe871129fe09eda3fc4330ce796e870514e2370616e51291c22
6
+ metadata.gz: f36e78f1c60459a325ac2aa63e0de725772d84b6041bca125a06a5186458a4b4a58c219073e3dd4f04ac453b72a3ec446718b3db319f5046da4d97a5730d0c5e
7
+ data.tar.gz: f6db15840e9c67fb4aa14abce022df6482471ec1dd9ae870e5ac9cdb1a3dfafde0ce81623ae76a21d1dcdf1ad1503788d463a629f88138c46932707ab9883b34
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ### 1.2.26
2
+
3
+ 2023-08-21 10:26
4
+
5
+ #### NEW
6
+
7
+ - `na finish` and `na archive` subcommands as aliases for equivalant `update` commands
8
+
9
+ #### FIXED
10
+
11
+ - --archive flag for `na finish`
12
+
1
13
  ### 1.2.25
2
14
 
3
15
  2023-08-21 07:23
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.2.25)
4
+ na (1.2.26)
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.25
12
+ The current version of `na` is 1.2.26
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.25
80
+ 1.2.26
81
81
 
82
82
  GLOBAL OPTIONS
83
83
  -a, --add - Add a next action (deprecated, for backwards compatibility)
@@ -98,7 +98,9 @@ GLOBAL OPTIONS
98
98
 
99
99
  COMMANDS
100
100
  add - Add a new next action
101
+ archive - Mark an action as @done and archive
101
102
  changes, changelog - Display the changelog
103
+ complete, finish - Find and mark an action as @done
102
104
  edit - Open a todo file in the default editor
103
105
  find, grep - Find actions matching a search pattern
104
106
  help - Shows a list of commands or help for one command
data/bin/na CHANGED
@@ -397,6 +397,102 @@ class App
397
397
  end
398
398
  end
399
399
 
400
+ desc 'Find and mark an action as @done'
401
+ arg_name 'ACTION'
402
+ command %i[complete finish] do |c|
403
+ c.example 'na complete "An existing task"',
404
+ desc: 'Find "An existing task" and mark @done'
405
+ c.example 'na finish "An existing task"',
406
+ desc: 'Alias for complete'
407
+
408
+ c.desc 'Prompt for additional notes. Input will be appended to any existing note.
409
+ If STDIN input (piped) is detected, it will be used as a note.'
410
+ c.switch %i[n note], negatable: false
411
+
412
+ c.desc 'Overwrite note instead of appending'
413
+ c.switch %i[o overwrite], negatable: false
414
+
415
+ c.desc 'Add a @done tag to action and move to Archive'
416
+ c.switch %i[a archive], negatable: false
417
+
418
+ c.desc 'Specify the file to search for the task'
419
+ c.arg_name 'PATH'
420
+ c.flag %i[file]
421
+
422
+ c.desc 'Search for files X directories deep'
423
+ c.arg_name 'DEPTH'
424
+ c.flag %i[d depth], must_match: /^[1-9]$/, type: :integer, default_value: 1
425
+
426
+ c.desc 'Match actions containing tag. Allows value comparisons'
427
+ c.arg_name 'TAG'
428
+ c.flag %i[tagged], multiple: true
429
+
430
+ c.desc 'Act on all matches immediately (no menu)'
431
+ c.switch %i[all], negatable: false
432
+
433
+ c.desc 'Interpret search pattern as regular expression'
434
+ c.switch %i[e regex], negatable: false
435
+
436
+ c.desc 'Match pattern exactly'
437
+ c.switch %i[x exact], negatable: false
438
+
439
+ c.action do |global, options, args|
440
+ options[:finish] = true
441
+ options[:f] = true
442
+ options[:project] = 'Archive' if options[:archive]
443
+
444
+ cmd = commands[:update]
445
+ action = cmd.send(:get_action, nil)
446
+ action.call(global, options, args)
447
+ end
448
+ end
449
+
450
+ desc 'Mark an action as @done and archive'
451
+ arg_name 'ACTION'
452
+ command %i[archive] do |c|
453
+ c.example 'na archive "An existing task"',
454
+ desc: 'Find "An existing task", mark @done if needed, and move to archive'
455
+
456
+ c.desc 'Prompt for additional notes. Input will be appended to any existing note.
457
+ If STDIN input (piped) is detected, it will be used as a note.'
458
+ c.switch %i[n note], negatable: false
459
+
460
+ c.desc 'Overwrite note instead of appending'
461
+ c.switch %i[o overwrite], negatable: false
462
+
463
+ c.desc 'Specify the file to search for the task'
464
+ c.arg_name 'PATH'
465
+ c.flag %i[file]
466
+
467
+ c.desc 'Search for files X directories deep'
468
+ c.arg_name 'DEPTH'
469
+ c.flag %i[d depth], must_match: /^[1-9]$/, type: :integer, default_value: 1
470
+
471
+ c.desc 'Match actions containing tag. Allows value comparisons'
472
+ c.arg_name 'TAG'
473
+ c.flag %i[tagged], multiple: true
474
+
475
+ c.desc 'Act on all matches immediately (no menu)'
476
+ c.switch %i[all], negatable: false
477
+
478
+ c.desc 'Interpret search pattern as regular expression'
479
+ c.switch %i[e regex], negatable: false
480
+
481
+ c.desc 'Match pattern exactly'
482
+ c.switch %i[x exact], negatable: false
483
+
484
+ c.action do |global, options, args|
485
+ options[:done] = true
486
+ options[:finish] = true
487
+ options[:project] = 'Archive'
488
+ options[:archive] = true
489
+ options[:a] = true
490
+ cmd = commands[:update]
491
+ action = cmd.send(:get_action, nil)
492
+ action.call(global, options, args)
493
+ end
494
+ end
495
+
400
496
  desc 'Update an existing action'
401
497
  long_desc 'Provides an easy way to complete, prioritize, and tag existing actions.
402
498
 
@@ -534,8 +630,8 @@ class App
534
630
  end
535
631
 
536
632
  priority = options[:priority].to_i if options[:priority]&.to_i&.positive?
537
- add_tags = options[:tag].map { |t| t.sub(/^@/, '').wildcard_to_rx }
538
- remove_tags = options[:remove].map { |t| t.sub(/^@/, '').wildcard_to_rx }
633
+ add_tags = options[:tag] ? options[:tag].map { |t| t.sub(/^@/, '').wildcard_to_rx } : []
634
+ remove_tags = options[:remove] ? options[:remove].map { |t| t.sub(/^@/, '').wildcard_to_rx } : []
539
635
 
540
636
  stdin_note = NA.stdin ? NA.stdin.split("\n") : []
541
637
 
@@ -598,8 +694,10 @@ class App
598
694
 
599
695
  end
600
696
 
601
- options[:finish] = true if options[:archive]
602
- options[:project] = 'Archive' if options[:archive]
697
+ if options[:archive]
698
+ options[:finish] = true
699
+ options[:project] = 'Archive'
700
+ end
603
701
 
604
702
  NA.notify('{r}No search terms provided', exit_code: 1) if tokens.nil? && options[:tagged].empty?
605
703
 
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.2.25'
2
+ VERSION = '1.2.26'
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.24<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.2.25<!--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.25
4
+ version: 1.2.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra