na 1.1.1 → 1.1.3

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: 86cf7b6d0d90a97947ac3965432745d3b0b3da7e01a685b5a640901ed3e07aa0
4
- data.tar.gz: 77fc609f98aa873d5044e47f647dfde977f8557ab2a7e4627b85ea6fc15d03bc
3
+ metadata.gz: 182588b3837e44b8361cc7c77b1bb52e95323deb7be15062af5487bcca016c3d
4
+ data.tar.gz: c46e5ed7493ac655419e41154036913493fb21a5d73de68acd7d10923ea464f0
5
5
  SHA512:
6
- metadata.gz: e7f9272b539b71fed3c226ed903ff6a917a8f5e132f3f25b47d677f8af4b515c5afc0f061f3509a22cb9630859ed2a9716e8e913cadc54e7a74e40982a7759b7
7
- data.tar.gz: 7d6ff09ad2172ee68cf172d7b521c0814ef36346624f35eebf17707ec9fb9fe316c3e9879a00268c949d08df544a01f5f7a9dad610c187a30c9b3cabe438d9c3
6
+ metadata.gz: 91a8e4a51b093c696c691f240f2aa80d7775cd187c74954273bd477c9efbff8180dc14b895e98d1b825c26e2a87ef5393998dce741fc377cfe7a7cae4550d750
7
+ data.tar.gz: 82ff75620de7508e307f64f6d62286590ff8d68c657870ae4d11f91cd44fc8c6a09dcde14316768862b4dac5c889febbc87cdf46eb7b509457e8e7faaacc163c
data/CHANGELOG.md CHANGED
@@ -1,18 +1,26 @@
1
- ### 1.1.1
1
+ ### 1.1.3
2
2
 
3
- 2022-09-28 04:49
3
+ 2022-09-28 07:12
4
4
 
5
- #### CHANGED
5
+ #### FIXED
6
6
 
7
- - Belated minor version bump
7
+ - `na next --tag X` not working
8
+
9
+ ### 1.1.2
10
+
11
+ 2022-09-28 06:37
8
12
 
9
- ### 1.0.8
13
+ #### IMPROVED
14
+
15
+ - Detailed instructions after installing prompt hooks
10
16
 
11
- 2022-09-28 04:47
17
+ ### 1.1.1
12
18
 
13
- ### 1.0.7
19
+ 2022-09-28 04:49
14
20
 
15
- 2022-09-28 04:38
21
+ #### CHANGED
22
+
23
+ - Belated minor version bump
16
24
 
17
25
  ### 1.0.6
18
26
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- na (1.0.8)
4
+ na (1.1.3)
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.1.1
12
+ The current version of `na` is 1.1.3
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.
@@ -18,6 +18,14 @@ Used with Taskpaper files, it can add new todo items quickly from the command li
18
18
 
19
19
  It can also auto-display next actions when you enter a project directory, automatically locating any todo files and listing their next actions when you `cd` to the project (optionally recursive). See the [Prompt Hooks](#prompt-hooks) section for details.
20
20
 
21
+ ### Installation
22
+
23
+ Assuming you have Ruby and RubyGems installed, you can just run `gem install na`. If you run into errors, use `sudo gem install na`.
24
+
25
+ If you don't have Ruby/RubyGems, you can install them pretty easily with Homebrew, rvm, or asdf. I can't swear this tool is worth the time, but there _are_ a lot of great gems available...
26
+
27
+
28
+
21
29
  ### Features
22
30
 
23
31
  You can list next actions in files in the current directory by typing `na`. By default, `na` looks for `*.taskpaper` files and extracts items tagged `@na` and not `@done`. All of these can be changed in the configuration.
@@ -36,14 +44,6 @@ You can also quickly add todo items from the command line with the `add` subcomm
36
44
 
37
45
  If found, it will try to locate an `Inbox:` project, or create one if it doesn't exist. Any arguments after `add` will be combined to create a new task in TaskPaper format. They will automatically be assigned as next actions (tagged `@na`) and will show up when `na` lists the tasks for the project.
38
46
 
39
- ### Installation
40
-
41
- Assuming you have Ruby and RubyGems installed, you can just run `gem install na`. If you run into errors, use `sudo gem install na`.
42
-
43
- If you don't have Ruby/RubyGems, you can install them pretty easily with Homebrew, rvm, or asdf. I can't swear this tool is worth the time, but there _are_ a lot of great gems available...
44
-
45
-
46
-
47
47
  ### Usage
48
48
 
49
49
  ```
@@ -54,18 +54,18 @@ SYNOPSIS
54
54
  na [global options] command [command options] [arguments...]
55
55
 
56
56
  VERSION
57
- 1.0.4
57
+ 1.1.1
58
58
 
59
59
  GLOBAL OPTIONS
60
60
  -a, --[no-]add - Add a next action (deprecated, for backwards compatibility)
61
61
  -d, --depth=DEPTH - Recurse to depth (default: 1)
62
+ --[no-]debug - Display verbose output
62
63
  --ext=FILE_EXTENSION - File extension to consider a todo file (default: taskpaper)
63
64
  --help - Show this message
64
65
  -n, --[no-]note - Prompt for additional notes (deprecated, for backwards compatibility)
65
66
  --na_tag=TAG - Tag to consider a next action (default: na)
66
67
  -p, --priority=PRIORITY - Set a priority 0-5 (deprecated, for backwards compatibility) (default: none)
67
68
  -r, --[no-]recurse - Recurse 3 directories deep (deprecated, for backwards compatability) (default: enabled)
68
- --[no-]verbose - Display verbose output
69
69
  --version - Display the program version
70
70
 
71
71
  COMMANDS
@@ -76,6 +76,7 @@ COMMANDS
76
76
  init, create - Create a new todo file in the current directory
77
77
  initconfig - Initialize the config file using current global options
78
78
  next, show - Show next actions
79
+ prompt - Show or install prompt hooks for the current shell
79
80
  tagged - Find actions matching a tag
80
81
  ```
81
82
 
@@ -85,6 +86,8 @@ COMMANDS
85
86
 
86
87
  Example: `na add This feature @idea I have`
87
88
 
89
+ If you run the `add` command with no arguments, you'll be asked for input on the command line.
90
+
88
91
  ```
89
92
  NAME
90
93
  add - Add a new next action
@@ -98,9 +101,10 @@ DESCRIPTION
98
101
 
99
102
  COMMAND OPTIONS
100
103
  -f, --file=PATH - Specify the file to which the task should be added (default: none)
101
- -n, --[no-]note - Prompt for additional notes
104
+ -n, --note - Prompt for additional notes
102
105
  -p, --priority=arg - Add a priority level 1-5 (default: 0)
103
106
  -t, --tag=TAG - Use a tag other than the default next action tag (default: none)
107
+ -x - Don't add next action tag to new entry
104
108
 
105
109
  EXAMPLES
106
110
 
@@ -156,7 +160,7 @@ DESCRIPTION
156
160
 
157
161
  COMMAND OPTIONS
158
162
  -d, --depth=DEPTH - Recurse to depth (default: 1)
159
- -x, --[no-]exact - Match pattern exactly
163
+ -x, --exact - Match pattern exactly
160
164
 
161
165
  EXAMPLES
162
166
 
@@ -273,36 +277,15 @@ Note that I created a new YAML dictionary inside of the `:next:` command, and ad
273
277
 
274
278
  ### Prompt Hooks
275
279
 
276
- You can add a prompt command to your shell to have na automatically list your next actions when you `cd` into a directory. Add the appropriate command to your login file for your shell:
277
-
278
- _(You can add `-r` to any of these calls to na to automatically recurse 3 directories deep)_
279
-
280
- Bash (in ~/.bash_profile):
280
+ You can add a prompt command to your shell to have na automatically list your next actions when you `cd` into a directory. To install a prompt command for your current shell, just run `na prompt install`. It works with Zsh, Bash, and Fish. If you'd rather make the changes to your startup file yourself, run `na prompt show` to get the hook and instructions printed out for copying.
281
281
 
282
- ```bash
283
- last_command_was_cd() {
284
- [[ $(history 1|sed -e "s/^[ ]*[0-9]*[ ]*//") =~ ^((cd|z|j|jump|g|f|pushd|popd|exit)([ ]|$)) ]] && na
285
- }
286
- if [[ -z "$PROMPT_COMMAND" ]]; then
287
- PROMPT_COMMAND="eval 'last_command_was_cd'"
288
- else
289
- echo $PROMPT_COMMAND | grep -v -q "last_command_was_cd" && PROMPT_COMMAND="$PROMPT_COMMAND;"'eval "last_command_was_cd"'
290
- fi
291
- ```
282
+ > You can also get output for shells other than the one you're currently using by adding "bash", "zsh", or "fish" to the show or install command.
292
283
 
293
- Fish (in ~/.config/fish/conf.d/*.fish):
294
284
 
295
- ```fish
296
- function __should_na --on-variable PWD
297
- test -s (basename $PWD)".taskpaper" && na
298
- end
299
- ```
285
+ > You can add `-r` to any of the calls to na to automatically recurse 3 directories deep, or just set the depth config permanently
300
286
 
301
- Zsh (in ~/.zshrc):
302
287
 
303
- ```zsh
304
- chpwd() { na }
305
- ```
288
+ After installing a hook, you'll need to close your terminal and start a new session to initialize the new commands.
306
289
 
307
290
 
308
291
  ### Misc
@@ -313,4 +296,9 @@ If you have [gum][] installed, na will use it for command line input when adding
313
296
  [donate]: http://brettterpstra.com/donate/
314
297
  [github]: https://github.com/ttscoff/na_gem/
315
298
 
299
+
316
300
  PayPal link: [paypal.me/ttscoff](https://paypal.me/ttscoff)
301
+
302
+ ## Changelog
303
+
304
+ See [CHANGELOG.md](https://github.com/ttscoff/na_gem/blob/master/CHANGELOG.md)
data/bin/na CHANGED
@@ -37,7 +37,7 @@ class App
37
37
  flag %i[p priority]
38
38
 
39
39
  desc 'Prompt for additional notes (deprecated, for backwards compatibility)'
40
- switch %i[n note]
40
+ switch %i[n note], negatable: false
41
41
 
42
42
  desc 'Recurse 3 directories deep (deprecated, for backwards compatability)'
43
43
  switch %i[r recurse], default_value: false, negatable: true
@@ -92,6 +92,7 @@ class App
92
92
  end
93
93
 
94
94
  tag = options[:tag] == NA.na_tag ? nil : options[:tag]
95
+ tag = [{ tag: tag, value: nil }]
95
96
  files, actions = NA.parse_actions(depth: depth,
96
97
  query: tokens,
97
98
  tag: tag)
@@ -113,7 +114,7 @@ class App
113
114
  desc: 'Add a new action to the Inbox, set its @priority to 4, and prompt for an additional note'
114
115
 
115
116
  c.desc 'Prompt for additional notes'
116
- c.switch %i[n note]
117
+ c.switch %i[n note], negatable: false
117
118
 
118
119
  c.desc 'Add a priority level 1-5'
119
120
  c.flag %i[p priority], must_match: /[1-5]/, type: :integer, default_value: 0
@@ -213,7 +214,7 @@ class App
213
214
  c.example 'na find -d 3 swift obj-c', desc: 'Find all actions 3 directories deep containing either swift or obj-c'
214
215
 
215
216
  c.desc 'Match pattern exactly'
216
- c.switch %i[x exact]
217
+ c.switch %i[x exact], negatable: false
217
218
 
218
219
  c.desc 'Recurse to depth'
219
220
  c.arg_name 'DEPTH'
@@ -402,12 +403,11 @@ class App
402
403
  end
403
404
  end
404
405
 
405
-
406
-
407
406
  pre do |global, command, options, args|
408
407
  NA.verbose = global[:debug]
409
408
  NA.extension = global[:ext]
410
409
  NA.na_tag = global[:na_tag]
410
+ NA.weed_cache_file
411
411
  true
412
412
  end
413
413
 
@@ -81,7 +81,7 @@ module NA
81
81
  else
82
82
  '%filename%parent%action'
83
83
  end
84
- elsif NA.find_files(depth: depth).count > 1
84
+ elsif find_files(depth: depth).count > 1
85
85
  if depth > 1
86
86
  '%filename%parent%action'
87
87
  else
@@ -103,11 +103,13 @@ module NA
103
103
  optional = []
104
104
 
105
105
  tag&.each do |t|
106
- new_rx = " @#{t[:tag]}"
107
- new_rx = "#{new_rx}\\(#{t[:value]}\\)" if t[:value]
106
+ unless t[:tag].nil?
107
+ new_rx = " @#{t[:tag]}"
108
+ new_rx = "#{new_rx}\\(#{t[:value]}\\)" if t[:value]
108
109
 
109
- optional.push(new_rx)
110
- required.push(new_rx) if t[:required]
110
+ optional.push(new_rx)
111
+ required.push(new_rx) if t[:required]
112
+ end
111
113
  end
112
114
 
113
115
  unless search.nil?
data/lib/na/prompt.rb CHANGED
@@ -54,7 +54,8 @@ module NA
54
54
  file = prompt_file(shell)
55
55
 
56
56
  File.open(File.expand_path(file), 'a') { |f| f.puts prompt_hook(shell) }
57
- $stderr.puts NA::Color.template("{y}Added {bw}#{shell}{xy} prompt hook to {bw}#{file}{x}")
57
+ $stderr.puts NA::Color.template("{y}Added {bw}#{shell}{xy} prompt hook to {bw}#{file}{xy}.{x}")
58
+ $stderr.puts NA::Color.template("{y}You may need to close the current terminal and open a new one to enable the script.{x}")
58
59
  end
59
60
  end
60
61
  end
data/lib/na/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Na
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.3'
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.0.8<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.1.2<!--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
 
@@ -17,6 +17,14 @@ Used with Taskpaper files, it can add new todo items quickly from the command li
17
17
 
18
18
  It can also auto-display next actions when you enter a project directory, automatically locating any todo files and listing their next actions when you `cd` to the project (optionally recursive). See the [Prompt Hooks](#prompt-hooks) section for details.
19
19
 
20
+ ### Installation
21
+
22
+ Assuming you have Ruby and RubyGems installed, you can just run `gem install na`. If you run into errors, use `sudo gem install na`.
23
+
24
+ If you don't have Ruby/RubyGems, you can install them pretty easily with Homebrew, rvm, or asdf. I can't swear this tool is worth the time, but there _are_ a lot of great gems available...
25
+
26
+ <!--JEKYLL> You can find the na source code (MIT license) on [GitHub][].-->
27
+
20
28
  ### Features
21
29
 
22
30
  You can list next actions in files in the current directory by typing `na`. By default, `na` looks for `*.taskpaper` files and extracts items tagged `@na` and not `@done`. All of these can be changed in the configuration.
@@ -35,14 +43,6 @@ You can also quickly add todo items from the command line with the `add` subcomm
35
43
 
36
44
  If found, it will try to locate an `Inbox:` project, or create one if it doesn't exist. Any arguments after `add` will be combined to create a new task in TaskPaper format. They will automatically be assigned as next actions (tagged `@na`) and will show up when `na` lists the tasks for the project.
37
45
 
38
- ### Installation
39
-
40
- Assuming you have Ruby and RubyGems installed, you can just run `gem install na`. If you run into errors, use `sudo gem install na`.
41
-
42
- If you don't have Ruby/RubyGems, you can install them pretty easily with Homebrew, rvm, or asdf. I can't swear this tool is worth the time, but there _are_ a lot of great gems available...
43
-
44
- <!--JEKYLL> You can find the na source code (MIT license) on [GitHub][].-->
45
-
46
46
  ### Usage
47
47
 
48
48
  ```
@@ -53,18 +53,18 @@ SYNOPSIS
53
53
  na [global options] command [command options] [arguments...]
54
54
 
55
55
  VERSION
56
- 1.0.4
56
+ 1.1.1
57
57
 
58
58
  GLOBAL OPTIONS
59
59
  -a, --[no-]add - Add a next action (deprecated, for backwards compatibility)
60
60
  -d, --depth=DEPTH - Recurse to depth (default: 1)
61
+ --[no-]debug - Display verbose output
61
62
  --ext=FILE_EXTENSION - File extension to consider a todo file (default: taskpaper)
62
63
  --help - Show this message
63
64
  -n, --[no-]note - Prompt for additional notes (deprecated, for backwards compatibility)
64
65
  --na_tag=TAG - Tag to consider a next action (default: na)
65
66
  -p, --priority=PRIORITY - Set a priority 0-5 (deprecated, for backwards compatibility) (default: none)
66
67
  -r, --[no-]recurse - Recurse 3 directories deep (deprecated, for backwards compatability) (default: enabled)
67
- --[no-]verbose - Display verbose output
68
68
  --version - Display the program version
69
69
 
70
70
  COMMANDS
@@ -75,6 +75,7 @@ COMMANDS
75
75
  init, create - Create a new todo file in the current directory
76
76
  initconfig - Initialize the config file using current global options
77
77
  next, show - Show next actions
78
+ prompt - Show or install prompt hooks for the current shell
78
79
  tagged - Find actions matching a tag
79
80
  ```
80
81
 
@@ -84,6 +85,8 @@ COMMANDS
84
85
 
85
86
  Example: `na add This feature @idea I have`
86
87
 
88
+ If you run the `add` command with no arguments, you'll be asked for input on the command line.
89
+
87
90
  ```
88
91
  NAME
89
92
  add - Add a new next action
@@ -97,9 +100,10 @@ DESCRIPTION
97
100
 
98
101
  COMMAND OPTIONS
99
102
  -f, --file=PATH - Specify the file to which the task should be added (default: none)
100
- -n, --[no-]note - Prompt for additional notes
103
+ -n, --note - Prompt for additional notes
101
104
  -p, --priority=arg - Add a priority level 1-5 (default: 0)
102
105
  -t, --tag=TAG - Use a tag other than the default next action tag (default: none)
106
+ -x - Don't add next action tag to new entry
103
107
 
104
108
  EXAMPLES
105
109
 
@@ -155,7 +159,7 @@ DESCRIPTION
155
159
 
156
160
  COMMAND OPTIONS
157
161
  -d, --depth=DEPTH - Recurse to depth (default: 1)
158
- -x, --[no-]exact - Match pattern exactly
162
+ -x, --exact - Match pattern exactly
159
163
 
160
164
  EXAMPLES
161
165
 
@@ -272,36 +276,15 @@ Note that I created a new YAML dictionary inside of the `:next:` command, and ad
272
276
 
273
277
  ### Prompt Hooks
274
278
 
275
- You can add a prompt command to your shell to have na automatically list your next actions when you `cd` into a directory. Add the appropriate command to your login file for your shell:
276
-
277
- _(You can add `-r` to any of these calls to na to automatically recurse 3 directories deep)_
278
-
279
- Bash (in ~/.bash_profile):
279
+ You can add a prompt command to your shell to have na automatically list your next actions when you `cd` into a directory. To install a prompt command for your current shell, just run `na prompt install`. It works with Zsh, Bash, and Fish. If you'd rather make the changes to your startup file yourself, run `na prompt show` to get the hook and instructions printed out for copying.
280
280
 
281
- ```bash
282
- last_command_was_cd() {
283
- [[ $(history 1|sed -e "s/^[ ]*[0-9]*[ ]*//") =~ ^((cd|z|j|jump|g|f|pushd|popd|exit)([ ]|$)) ]] && na
284
- }
285
- if [[ -z "$PROMPT_COMMAND" ]]; then
286
- PROMPT_COMMAND="eval 'last_command_was_cd'"
287
- else
288
- echo $PROMPT_COMMAND | grep -v -q "last_command_was_cd" && PROMPT_COMMAND="$PROMPT_COMMAND;"'eval "last_command_was_cd"'
289
- fi
290
- ```
291
-
292
- Fish (in ~/.config/fish/conf.d/*.fish):
293
-
294
- ```fish
295
- function __should_na --on-variable PWD
296
- test -s (basename $PWD)".taskpaper" && na
297
- end
298
- ```
281
+ > You can also get output for shells other than the one you're currently using by adding "bash", "zsh", or "fish" to the show or install command.
282
+ <!--JEKYLL{:.tip}-->
299
283
 
300
- Zsh (in ~/.zshrc):
284
+ > You can add `-r` to any of the calls to na to automatically recurse 3 directories deep, or just set the depth config permanently
285
+ <!--JEKYLL{:.tip}-->
301
286
 
302
- ```zsh
303
- chpwd() { na }
304
- ```
287
+ After installing a hook, you'll need to close your terminal and start a new session to initialize the new commands.
305
288
 
306
289
 
307
290
  ### Misc
@@ -312,8 +295,10 @@ If you have [gum][] installed, na will use it for command line input when adding
312
295
  [donate]: http://brettterpstra.com/donate/
313
296
  [github]: https://github.com/ttscoff/na_gem/
314
297
 
315
- <!--GITHUB-->PayPal link: [paypal.me/ttscoff](https://paypal.me/ttscoff)<!--END GITHUB-->
316
- <!--END README-->
298
+ <!--GITHUB-->
299
+ PayPal link: [paypal.me/ttscoff](https://paypal.me/ttscoff)
300
+
317
301
  ## Changelog
318
302
 
319
303
  See [CHANGELOG.md](https://github.com/ttscoff/na_gem/blob/master/CHANGELOG.md)
304
+ <!--END GITHUB--><!--END README-->
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.1.1
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra