na 1.2.86 → 1.2.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05b84c85234711e95bc6fae91b279577d0908ba7bc0b1fb254729d65c2823f99
4
- data.tar.gz: acf70b87b92d32a81ae7802397e3f72fd72b28410c50556c680ad0f05c6ea21f
3
+ metadata.gz: d30aa922aad5901cf7d844f0a41250ab6245cf3bb2eb89e92e14e890f74088b5
4
+ data.tar.gz: 253d3825d1a0c2cb8666cd478b608ac77fee44ceb75cee15f9192f57c33a4b5b
5
5
  SHA512:
6
- metadata.gz: 627981de849f31ca58ba38ff7e40915baf7cbf32f4a78d005f35a2590b853a477e28e71c209b5974cb9f4eae311d3f9e4c14c4fd690a253c16584bcac7d48fb1
7
- data.tar.gz: 362e2719a19069a27cad8937d3ed7cabd81a7fd57a2b9f6a1dfa72ff439adf3fd64e691f651ad46020cdd4cdd08d0b6161b93adfcaf75c96040cf75451397a2f
6
+ metadata.gz: 80c1708db72e9683f0de4acb35a762b31d3de02c4062ecf8f028d83997d2f40c9545e0c3601505dd80e7e2a985c53bfa9504011ff0a5f9321da066e633649a75
7
+ data.tar.gz: 7e95f4f33952c819bd33cdad8316aeafbc1c6bf05dbed1ff59ea887b64a7dd4bee3d70de9b5a1b092e53e2c1db3626813e38e679d5544b27b2607b0f78eda22a
@@ -0,0 +1,4 @@
1
+ Write a commmit message that uses @ labels to specify what type of change each line is. Apply @new, @fixed, @changed, @improved, and @breaking as appropriate to each line. Only add @ labels to changes that affect the user, not technical details. Technical details can be included in the commit, just don't add @ labels to those lines. Be sure to include a general description (< 60 characters) as the first line, followed by a line break.
2
+
3
+
4
+ Save this commit message to commit_message.txt. Overwrite existing contents.
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2025-10-27 21:36:52 UTC using RuboCop version 1.75.7.
3
+ # on 2025-10-28 10:51:34 UTC using RuboCop version 1.75.7.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -21,46 +21,51 @@ Lint/UnusedMethodArgument:
21
21
  Exclude:
22
22
  - 'lib/na/string.rb'
23
23
 
24
- # Offense count: 36
24
+ # Offense count: 39
25
25
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
26
26
  Metrics/AbcSize:
27
- Max: 243
27
+ Max: 276
28
28
 
29
- # Offense count: 9
29
+ # Offense count: 11
30
30
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
31
31
  # AllowedMethods: refine
32
32
  Metrics/BlockLength:
33
- Max: 144
33
+ Max: 158
34
34
 
35
35
  # Offense count: 5
36
+ # Configuration parameters: CountBlocks, CountModifierForms.
37
+ Metrics/BlockNesting:
38
+ Max: 4
39
+
40
+ # Offense count: 6
36
41
  # Configuration parameters: CountComments, CountAsOne.
37
42
  Metrics/ClassLength:
38
- Max: 777
43
+ Max: 829
39
44
 
40
- # Offense count: 25
45
+ # Offense count: 29
41
46
  # Configuration parameters: AllowedMethods, AllowedPatterns.
42
47
  Metrics/CyclomaticComplexity:
43
- Max: 70
48
+ Max: 82
44
49
 
45
- # Offense count: 40
50
+ # Offense count: 44
46
51
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
47
52
  Metrics/MethodLength:
48
- Max: 146
53
+ Max: 183
49
54
 
50
- # Offense count: 3
55
+ # Offense count: 4
51
56
  # Configuration parameters: CountComments, CountAsOne.
52
57
  Metrics/ModuleLength:
53
- Max: 779
58
+ Max: 831
54
59
 
55
- # Offense count: 4
60
+ # Offense count: 5
56
61
  # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
57
62
  Metrics/ParameterLists:
58
- Max: 19
63
+ Max: 22
59
64
 
60
- # Offense count: 24
65
+ # Offense count: 29
61
66
  # Configuration parameters: AllowedMethods, AllowedPatterns.
62
67
  Metrics/PerceivedComplexity:
63
- Max: 81
68
+ Max: 94
64
69
 
65
70
  # Offense count: 1
66
71
  # Configuration parameters: ForbiddenDelimiters.
@@ -105,7 +110,7 @@ Style/YAMLFileRead:
105
110
  Exclude:
106
111
  - 'lib/na/theme.rb'
107
112
 
108
- # Offense count: 22
113
+ # Offense count: 27
109
114
  # This cop supports safe autocorrection (--autocorrect).
110
115
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
111
116
  # URISchemes: http, https
data/CHANGELOG.md CHANGED
@@ -1,6 +1,63 @@
1
+ ### 1.2.87
2
+
3
+ 2025-10-28 06:21
4
+
5
+ #### CHANGED
6
+
7
+ - Default theme/templates include `%line`; users with custom theme may need to regenerate to see line numbers
8
+
9
+ #### NEW
10
+
11
+ - Display line numbers with actions across `na next` and selection
12
+ - Support `PATH:LINE` targeting in `na update` and `na edit`
13
+ - Multi-action editing in external editor using `# ------ PATH:LINE` markers; notes supported beneath each action
14
+ - Add --started flag on add/complete(update) to set @started
15
+ - Add --finished alias to --end on add/complete/update to set @done
16
+ - Add --duration (add/complete/update); backfills @started from --end
17
+ - Add --times (next/tagged) to show per-action durations and totals
18
+ - Add --human (next/tagged) for human-friendly duration format
19
+ - Add --only_timed (next/tagged) to show only items with @started/@done
20
+ - Add --json_times to next/tagged (JSON of timed actions, tags, total)
21
+ - Add --only_times to next/tagged (show only totals, no action list)
22
+
23
+ #### IMPROVED
24
+
25
+ - --times and --only_timed imply --done for next/tagged
26
+ - Duration annotations render with theme colors in output
27
+ - Natural-language dates for @started/@done normalized automatically
28
+ - Support shorthand: 2h30m, 30m ago, -2:30, 2:05 ago
29
+ - --only_timed, --times, and --json_times imply --done automatically
30
+ - Per-tag duration totals rendered as aligned Markdown table with footer
31
+ - Duration color configurable via theme key `duration` (default {y})
32
+
33
+ #### FIXED
34
+
35
+ - Incorrect colorization (unexpected bright green) in action output
36
+ - Search highlighting no longer corrupts ANSI color codes or numbers in escape sequences
37
+ - Multi-action editor now only includes the specifically selected lines (no duplicates)
38
+ - Delete in update menu removes the correct lines
39
+ - Multi-select updates process bottom-to-top to avoid line shifts
40
+ - String wrapping now wraps at requested widths (e.g., 60 cols) and indents
41
+
1
42
  ### 1.2.86
2
43
 
3
- 2025-10-27 17:16
44
+ 2025-10-28 02:29
45
+
46
+ #### CHANGED
47
+
48
+ - Default theme/templates include `%line`; users with custom theme may need to regenerate to see line numbers
49
+
50
+ #### NEW
51
+
52
+ - Display line numbers with actions across `na next` and selection
53
+ - Support `PATH:LINE` targeting in `na update` and `na edit`
54
+ - Multi-action editing in external editor using `# ------ PATH:LINE` markers; notes supported beneath each action
55
+
56
+ #### FIXED
57
+
58
+ - Incorrect colorization (unexpected bright green) in action output
59
+ - Search highlighting no longer corrupts ANSI color codes or numbers in escape sequences
60
+ - Multi-action editor now only includes the specifically selected lines (no duplicates)
4
61
 
5
62
  ### 1.2.85
6
63
 
data/Gemfile CHANGED
@@ -4,4 +4,10 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
  gem 'rake'
6
6
 
7
- gem "simplecov", "~> 0.22.0", group: :development
7
+ gem 'simplecov', '~> 0.22.0', group: :development
8
+
9
+ group :development do
10
+ gem 'rubocop', '~> 1.66'
11
+ gem 'rubocop-performance', '~> 1.21'
12
+ end
13
+ gem 'chronic'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.2.86)
4
+ na (1.2.87)
5
5
  chronic (~> 0.10, >= 0.10.2)
6
6
  git (~> 3.0.0)
7
7
  gli (~> 2.21.0)
@@ -29,6 +29,7 @@ GEM
29
29
  uri (>= 0.13.1)
30
30
  addressable (2.8.7)
31
31
  public_suffix (>= 2.0.2, < 7.0)
32
+ ast (2.4.3)
32
33
  base64 (0.3.0)
33
34
  bigdecimal (3.3.1)
34
35
  bump (0.6.1)
@@ -47,15 +48,25 @@ GEM
47
48
  i18n (1.14.7)
48
49
  concurrent-ruby (~> 1.0)
49
50
  json (2.15.2)
51
+ language_server-protocol (3.17.0.5)
52
+ lint_roller (1.1.0)
50
53
  logger (1.7.0)
51
54
  mdless (1.0.37)
52
55
  minitest (5.26.0)
53
56
  ostruct (0.6.3)
57
+ parallel (1.27.0)
58
+ parser (3.3.8.0)
59
+ ast (~> 2.4.1)
60
+ racc
61
+ prism (1.6.0)
54
62
  process_executer (1.3.0)
55
63
  public_suffix (6.0.2)
64
+ racc (1.8.1)
65
+ rainbow (3.1.1)
56
66
  rake (13.3.0)
57
67
  rchardet (1.10.0)
58
68
  rdoc (4.3.0)
69
+ regexp_parser (2.10.0)
59
70
  rspec (3.13.0)
60
71
  rspec-core (~> 3.13.0)
61
72
  rspec-expectations (~> 3.13.0)
@@ -69,6 +80,25 @@ GEM
69
80
  diff-lcs (>= 1.2.0, < 2.0)
70
81
  rspec-support (~> 3.13.0)
71
82
  rspec-support (3.13.6)
83
+ rubocop (1.75.7)
84
+ json (~> 2.3)
85
+ language_server-protocol (~> 3.17.0.2)
86
+ lint_roller (~> 1.1.0)
87
+ parallel (~> 1.10)
88
+ parser (>= 3.3.0.2)
89
+ rainbow (>= 2.2.2, < 4.0)
90
+ regexp_parser (>= 2.9.3, < 3.0)
91
+ rubocop-ast (>= 1.44.0, < 2.0)
92
+ ruby-progressbar (~> 1.7)
93
+ unicode-display_width (>= 2.4.0, < 4.0)
94
+ rubocop-ast (1.44.1)
95
+ parser (>= 3.3.7.2)
96
+ prism (~> 1.4)
97
+ rubocop-performance (1.25.0)
98
+ lint_roller (~> 1.1)
99
+ rubocop (>= 1.75.0, < 2.0)
100
+ rubocop-ast (>= 1.38.0, < 2.0)
101
+ ruby-progressbar (1.13.0)
72
102
  securerandom (0.4.1)
73
103
  simplecov (0.22.0)
74
104
  docile (~> 1.1)
@@ -87,6 +117,9 @@ GEM
87
117
  tty-which (0.5.0)
88
118
  tzinfo (2.0.6)
89
119
  concurrent-ruby (~> 1.0)
120
+ unicode-display_width (3.1.4)
121
+ unicode-emoji (~> 4.0, >= 4.0.4)
122
+ unicode-emoji (4.0.4)
90
123
  uri (1.0.4)
91
124
  wisper (2.0.1)
92
125
 
@@ -105,11 +138,14 @@ PLATFORMS
105
138
 
106
139
  DEPENDENCIES
107
140
  bump (~> 0.6.0)
141
+ chronic
108
142
  minitest (~> 5.14)
109
143
  na!
110
144
  rake
111
145
  rdoc (~> 4.3)
112
146
  rspec (~> 3.0)
147
+ rubocop (~> 1.66)
148
+ rubocop-performance (~> 1.21)
113
149
  simplecov (~> 0.22.0)
114
150
  tty-spinner (~> 0.9, >= 0.9.0)
115
151
 
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.86.
12
+ The current version of `na` is 1.2.87.
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
 
@@ -76,7 +76,7 @@ SYNOPSIS
76
76
  na [global options] command [command options] [arguments...]
77
77
 
78
78
  VERSION
79
- 1.2.86
79
+ 1.2.87
80
80
 
81
81
  GLOBAL OPTIONS
82
82
  -a, --add - Add a next action (deprecated, for backwards compatibility)
@@ -152,11 +152,14 @@ DESCRIPTION
152
152
  COMMAND OPTIONS
153
153
  --at=POSITION - Add task at [s]tart or [e]nd of target project (default: none)
154
154
  -d, --depth=DEPTH - Search for files X directories deep (default: 1)
155
+ --duration=DURATION - Duration (e.g. 45m, 2h, 1d2h30m, or minutes) (default: none)
156
+ --end, --finished=DATE - End/Finished time (natural language or ISO) (default: none)
155
157
  -f, --file=PATH - Specify the file to which the task should be added (default: none)
156
158
  --finish, --done - Mark task as @done with date
157
159
  --in, --todo=TODO_FILE - Add to a known todo file, partial matches allowed (default: none)
158
160
  -n, --note - Prompt for additional notes. STDIN input (piped) will be treated as a note if present.
159
161
  -p, --priority=PRIO - Add a priority level 1-5 or h, m, l (default: 0)
162
+ --started=DATE - Started time (natural language or ISO) (default: none)
160
163
  -t, --tag=TAG - Use a tag other than the default next action tag (default: none)
161
164
  --to, --project, --proj=PROJECT - Add action to specific project (default: Inbox)
162
165
  -x - Don't add next action tag to new entry
@@ -223,6 +226,7 @@ COMMAND OPTIONS
223
226
  -d, --depth=DEPTH - Recurse to depth (default: none)
224
227
  --[no-]done - Include @done actions
225
228
  -e, --regex - Interpret search pattern as regular expression
229
+ --human - Format durations in human-friendly form
226
230
  --in=TODO_PATH - Show actions from a specific todo file in history. May use wildcards (* and ?) (default: none)
227
231
  --nest - Output actions nested by file
228
232
  --no_file - No filename in output
@@ -233,6 +237,7 @@ COMMAND OPTIONS
233
237
  --save=TITLE - Save this search for future use (default: none)
234
238
  --[no-]search_notes - Include notes in search (default: enabled)
235
239
  --tagged=TAG - Match actions containing tag. Allows value comparisons (may be used more than once, default: none)
240
+ --times - Show per-action durations and total
236
241
  -v, --invert - Show actions not matching search pattern
237
242
  -x, --exact - Match pattern exactly
238
243
 
@@ -337,11 +342,15 @@ COMMAND OPTIONS
337
342
  --exact - Search query is exact text match (not tokens)
338
343
  --file=TODO_FILE - Display matches from specific todo file ([relative] path) (default: none)
339
344
  --hidden - Include hidden directories while traversing
345
+ --human - Format durations in human-friendly form
340
346
  --in, --todo=TODO - Display matches from a known todo file anywhere in history (short name) (may be used more than once, default: none)
347
+ --json_times - Output times as JSON object (implies --times and --done)
341
348
  --nest - Output actions nested by file
342
349
  --no_file - No filename in output
343
350
  --[no-]notes - Include notes in output
344
351
  --omnifocus - Output actions nested by file and project
352
+ --only_timed - Show only actions that have a duration (@started and @done)
353
+ --only_times - Output only elapsed time totals (implies --times and --done)
345
354
  -p, --prio, --priority=PRIORITY - Match actions with priority, allows <>= comparison (may be used more than once, default: none)
346
355
  --proj, --project=PROJECT[/SUBPROJECT] - Show actions from a specific project (default: none)
347
356
  --regex - Search query is regular expression
@@ -350,6 +359,7 @@ COMMAND OPTIONS
350
359
  --[no-]search_notes - Include notes in search (default: enabled)
351
360
  -t, --tag=TAG - Alternate tag to search for (default: none)
352
361
  --tagged=TAG - Match actions containing tag. Allows value comparisons (may be used more than once, default: none)
362
+ --times - Show per-action durations and total
353
363
 
354
364
  EXAMPLES
355
365
 
@@ -491,17 +501,22 @@ COMMAND OPTIONS
491
501
  -d, --depth=DEPTH - Recurse to depth (default: 1)
492
502
  --[no-]done - Include @done actions
493
503
  --exact - Search query is exact text match (not tokens)
504
+ --human - Format durations in human-friendly form
494
505
  --in=TODO_PATH - Show actions from a specific todo file in history. May use wildcards (* and ?) (default: none)
506
+ --json_times - Output times as JSON object (implies --times and --done)
495
507
  --nest - Output actions nested by file
496
508
  --no_file - No filename in output
497
509
  --[no-]notes - Include notes in output
498
510
  -o, --or - Combine tags with OR, displaying actions matching ANY of the tags
499
511
  --omnifocus - Output actions nested by file and project
512
+ --only_timed - Show only actions that have a duration (@started and @done)
513
+ --only_times - Output only elapsed time totals (implies --times and --done)
500
514
  --proj, --project=PROJECT[/SUBPROJECT] - Show actions from a specific project (default: none)
501
515
  --regex - Search query is regular expression
502
516
  --save=TITLE - Save this search for future use (default: none)
503
517
  --search, --find, --grep=QUERY - Filter results using search terms (may be used more than once, default: none)
504
518
  --[no-]search_notes - Include notes in search (default: enabled)
519
+ --times - Show per-action durations and total
505
520
  -v, --invert - Show actions not matching tags
506
521
 
507
522
  EXAMPLES
@@ -595,8 +610,10 @@ COMMAND OPTIONS
595
610
  -d, --depth=DEPTH - Search for files X directories deep (default: 1)
596
611
  --delete - Delete an action
597
612
  --[no-]done - Include @done actions
613
+ --duration=DURATION - Duration (e.g. 45m, 2h, 1d2h30m, or minutes) (default: none)
598
614
  -e, --regex - Interpret search pattern as regular expression
599
615
  --edit - Open action in editor (vim). Natural language dates will be parsed and converted in date-based tags.
616
+ --end, --finished=DATE - End/Finished time (natural language or ISO) (default: none)
600
617
  -f, --finish - Add a @done tag to action
601
618
  --file=PATH - Specify the file to search for the task (default: none)
602
619
  --in, --todo=TODO_FILE - Use a known todo file, partial matches allowed (default: none)
@@ -609,6 +626,7 @@ COMMAND OPTIONS
609
626
  --restore - Remove @done tag from action
610
627
  --search, --find, --grep=QUERY - Filter results using search terms (may be used more than once, default: none)
611
628
  --[no-]search_notes - Include notes in search (default: enabled)
629
+ --started=DATE - Started time (natural language or ISO) (default: none)
612
630
  -t, --tag=TAG - Add a tag to the action, @tag(values) allowed, use multiple times or combine multiple tags with a comma (may be used more than once, default: none)
613
631
  --tagged=TAG - Match actions containing tag. Allows value comparisons (may be used more than once, default: none)
614
632
  --to, --move=PROJECT - Move action to specific project (default: none)
@@ -626,6 +644,49 @@ EXAMPLES
626
644
  na update --archive My cool action
627
645
  ```
628
646
 
647
+ #### Time tracking
648
+
649
+ `na` supports tracking elapsed time between a start and finish for actions using `@started(YYYY-MM-DD HH:MM)` and `@done(YYYY-MM-DD HH:MM)` tags. Durations are not stored; they are calculated on the fly from these tags.
650
+
651
+ - Add/Finish/Update flags:
652
+ - `--started TIME` set a start time when creating or finishing an item
653
+ - `--end TIME` (alias `--finished`) set a done time
654
+ - `--duration DURATION` backfill start time from the provided end time
655
+ - All flags accept natural language (via Chronic) and shorthand: `30m ago`, `-2h`, `2h30m`, `2:30 ago`, `yesterday 5pm`
656
+
657
+ Examples:
658
+
659
+ ```bash
660
+ na add --started "30 minutes ago" "Investigate bug"
661
+ na complete --finished now --duration 2h30m "Investigate bug"
662
+ na update --started "yesterday 3pm" --end "yesterday 5:15pm" "Investigate bug"
663
+ ```
664
+
665
+ - Display flags (next/tagged):
666
+ - `--times` show per???action durations and a grand total (implies `--done`)
667
+ - `--human` format durations as human???readable text instead of `DD:HH:MM:SS`
668
+ - `--only_timed` show only actions that have both `@started` and `@done` (implies `--times --done`)
669
+ - `--only_times` output only the totals section (no action lines; implies `--times --done`)
670
+ - `--json_times` output a JSON object with timed items, per???tag totals, and overall total (implies `--times --done`)
671
+
672
+ Example outputs:
673
+
674
+ ```bash
675
+ # Per???action durations appended and totals table
676
+ na next --times --human
677
+
678
+ # Only totals table (Markdown), no action lines
679
+ na tagged "tag*=bug" --only_times
680
+
681
+ # JSON for scripting
682
+ na next --json_times > times.json
683
+ ```
684
+
685
+ Notes:
686
+
687
+ - Any newly added or edited action text is scanned for natural???language values in `@started(...)`/`@done(...)` and normalized to `YYYY???MM???DD HH:MM`.
688
+ - The color of durations in output is configurable via the theme key `duration` (defaults to `{y}`).
689
+
629
690
  ##### changelog
630
691
 
631
692
  View recent changes with `na changelog` or `na changes`.
@@ -655,7 +716,9 @@ COMMAND OPTIONS
655
716
  -a, --archive - Add a @done tag to action and move to Archive
656
717
  --all - Act on all matches immediately (no menu)
657
718
  -d, --depth=DEPTH - Search for files X directories deep (default: 1)
719
+ --duration=DURATION - Duration (e.g. 45m, 2h, 1d2h30m, or minutes) (default: none)
658
720
  -e, --regex - Interpret search pattern as regular expression
721
+ --end, --finished=DATE - End/Finished time (natural language or ISO) (default: none)
659
722
  --file=PATH - Specify the file to search for the task (default: none)
660
723
  --in, --todo=TODO_FILE - Use a known todo file, partial matches allowed (default: none)
661
724
  -n, --note - Prompt for additional notes. Input will be appended to any existing note. If STDIN input (piped) is detected, it will be used as a note.
@@ -663,6 +726,7 @@ COMMAND OPTIONS
663
726
  --proj, --project=PROJECT[/SUBPROJECT] - Affect actions from a specific project (default: none)
664
727
  --search, --find, --grep=QUERY - Filter results using search terms (may be used more than once, default: none)
665
728
  --[no-]search_notes - Include notes in search (default: enabled)
729
+ --started=DATE - Started time (natural language or ISO) (default: none)
666
730
  --tagged=TAG - Match actions containing tag. Allows value comparisons (may be used more than once, default: none)
667
731
  --to, --move=PROJECT - Add a @done tag and move action to specific project (default: none)
668
732
  -x, --exact - Match pattern exactly