na 1.1.1 → 1.1.2

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: 14ffbfb64ddda9c09900f1037c38d7f903b1ad16ae7d00e568ab07a7358973c7
4
+ data.tar.gz: f9fb349736f4cda36fb3d01ab624e93e78bcccae5b6a92853065539e25e0748c
5
5
  SHA512:
6
- metadata.gz: e7f9272b539b71fed3c226ed903ff6a917a8f5e132f3f25b47d677f8af4b515c5afc0f061f3509a22cb9630859ed2a9716e8e913cadc54e7a74e40982a7759b7
7
- data.tar.gz: 7d6ff09ad2172ee68cf172d7b521c0814ef36346624f35eebf17707ec9fb9fe316c3e9879a00268c949d08df544a01f5f7a9dad610c187a30c9b3cabe438d9c3
6
+ metadata.gz: 1b9b602e6bc966a29bdf7e3b37fc2dcd0c2ec69e4e7fe0af5cdc7df2495c337b1bcde0975dceb3d14e095b1cda95cc4b306d02cbd15fc9f3e0616b5ef56392c7
7
+ data.tar.gz: 5d7d8ca3b8bc07ced66eeeb5f70065047bb1a0e57585c6c3f7b915e67762769b19666fedd912773ba7eb09d46997f8a04354ab79b875cd292f33203a38429a89
data/CHANGELOG.md CHANGED
@@ -1,18 +1,18 @@
1
- ### 1.1.1
1
+ ### 1.1.2
2
2
 
3
- 2022-09-28 04:49
3
+ 2022-09-28 06:37
4
4
 
5
- #### CHANGED
5
+ #### IMPROVED
6
6
 
7
- - Belated minor version bump
7
+ - Detailed instructions after installing prompt hooks
8
8
 
9
- ### 1.0.8
9
+ ### 1.1.1
10
10
 
11
- 2022-09-28 04:47
11
+ 2022-09-28 04:49
12
12
 
13
- ### 1.0.7
13
+ #### CHANGED
14
14
 
15
- 2022-09-28 04:38
15
+ - Belated minor version bump
16
16
 
17
17
  ### 1.0.6
18
18
 
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.1)
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.2
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.
@@ -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
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
@@ -113,7 +113,7 @@ class App
113
113
  desc: 'Add a new action to the Inbox, set its @priority to 4, and prompt for an additional note'
114
114
 
115
115
  c.desc 'Prompt for additional notes'
116
- c.switch %i[n note]
116
+ c.switch %i[n note], negatable: false
117
117
 
118
118
  c.desc 'Add a priority level 1-5'
119
119
  c.flag %i[p priority], must_match: /[1-5]/, type: :integer, default_value: 0
@@ -213,7 +213,7 @@ class App
213
213
  c.example 'na find -d 3 swift obj-c', desc: 'Find all actions 3 directories deep containing either swift or obj-c'
214
214
 
215
215
  c.desc 'Match pattern exactly'
216
- c.switch %i[x exact]
216
+ c.switch %i[x exact], negatable: false
217
217
 
218
218
  c.desc 'Recurse to depth'
219
219
  c.arg_name 'DEPTH'
@@ -402,12 +402,11 @@ class App
402
402
  end
403
403
  end
404
404
 
405
-
406
-
407
405
  pre do |global, command, options, args|
408
406
  NA.verbose = global[:debug]
409
407
  NA.extension = global[:ext]
410
408
  NA.na_tag = global[:na_tag]
409
+ NA.weed_cache_file
411
410
  true
412
411
  end
413
412
 
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.2'
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.1<!--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
 
@@ -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):
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):
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.
293
280
 
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
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.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra