na 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/bin/na +11 -4
- data/lib/na/next_action.rb +6 -2
- data/lib/na/prompt.rb +3 -3
- data/lib/na/version.rb +1 -1
- data/src/README.md +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9aab87ece3f35afbe5280d6c1b777c9d8dece4916f796eedb3dfebdbbeb5032e
|
4
|
+
data.tar.gz: 46b7eef3d84ede3a69f9497e4d0bb4fcc772fd159fbffe23f9749f3172bc2cdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05bda9033431ce005ad32fb9cd1c711642504972ffa73131d1c989b90dd4b50089b53d9e6746df4555d87e9b65d8b3c2c3707023dd8a8287f8596f4583a727f5
|
7
|
+
data.tar.gz: d474663a84ca7ef0287f05c3c2ed6fa63b0fb3d6482337b33343bbfa71a7a7d1c4fe542f91d9c75797c48a4f073079b85a96ef6704d2056b193b7f891596cbf9
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
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.
|
12
|
+
The current version of `na` is 1.0.6.
|
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
|
|
data/bin/na
CHANGED
@@ -91,7 +91,7 @@ class App
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
|
-
tag = options[:tag] ==
|
94
|
+
tag = options[:tag] == NA.na_tag ? nil : options[:tag]
|
95
95
|
files, actions = NA.parse_actions(depth: depth,
|
96
96
|
query: tokens,
|
97
97
|
tag: tag)
|
@@ -122,6 +122,9 @@ class App
|
|
122
122
|
c.arg_name 'TAG'
|
123
123
|
c.flag %i[t tag]
|
124
124
|
|
125
|
+
c.desc 'Don\'t add next action tag to new entry'
|
126
|
+
c.switch %i[x]
|
127
|
+
|
125
128
|
c.desc 'Specify the file to which the task should be added'
|
126
129
|
c.arg_name 'PATH'
|
127
130
|
c.flag %i[f file]
|
@@ -147,9 +150,14 @@ class App
|
|
147
150
|
end
|
148
151
|
|
149
152
|
na_tag = NA.na_tag
|
150
|
-
|
153
|
+
if options[:x]
|
154
|
+
na_tag = ''
|
155
|
+
else
|
156
|
+
na_tag = options[:tag] unless options[:tag].nil?
|
157
|
+
na_tag = " @#{na_tag}"
|
158
|
+
end
|
151
159
|
|
152
|
-
action = "#{action.gsub(
|
160
|
+
action = "#{action.gsub(/#{na_tag}/, '')}#{na_tag}"
|
153
161
|
|
154
162
|
note = if options[:note]
|
155
163
|
if TTY::Which.exist?('gum')
|
@@ -191,7 +199,6 @@ class App
|
|
191
199
|
end
|
192
200
|
end
|
193
201
|
|
194
|
-
NA.save_working_dir(File.expand_path(target))
|
195
202
|
NA.add_action(target, action, note)
|
196
203
|
end
|
197
204
|
end
|
data/lib/na/next_action.rb
CHANGED
@@ -26,7 +26,9 @@ module NA
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def find_files(depth: 1)
|
29
|
-
`find . -name "*.#{NA.extension}" -maxdepth #{depth}`.strip.split("\n")
|
29
|
+
files = `find . -name "*.#{NA.extension}" -maxdepth #{depth}`.strip.split("\n")
|
30
|
+
files.each { |f| save_working_dir(File.expand_path(f)) }
|
31
|
+
files
|
30
32
|
end
|
31
33
|
|
32
34
|
def select_file(files)
|
@@ -151,12 +153,14 @@ module NA
|
|
151
153
|
indent_level = indent
|
152
154
|
end
|
153
155
|
elsif line =~ /^[ \t]*- / && line !~ / @done/
|
156
|
+
next unless line =~ /@#{NA.na_tag}\b/
|
157
|
+
|
154
158
|
unless optional.empty? && required.empty?
|
155
159
|
next unless line.matches(any: optional, all: required)
|
156
160
|
|
157
161
|
end
|
158
162
|
|
159
|
-
action = line.sub(/^[ \t]*- /, '').sub(/
|
163
|
+
action = line.sub(/^[ \t]*- /, '').sub(/ @#{NA.na_tag}\b/, '')
|
160
164
|
new_action = NA::Action.new(file, File.basename(file, ".#{NA.extension}"), parent.dup, action)
|
161
165
|
actions.push(new_action)
|
162
166
|
end
|
data/lib/na/prompt.rb
CHANGED
@@ -9,20 +9,20 @@ module NA
|
|
9
9
|
when :zsh
|
10
10
|
<<~EOHOOK
|
11
11
|
# zsh prompt hook for na
|
12
|
-
chpwd() { na }
|
12
|
+
chpwd() { na next }
|
13
13
|
EOHOOK
|
14
14
|
when :fish
|
15
15
|
<<~EOHOOK
|
16
16
|
# Fish Prompt Command
|
17
17
|
function __should_na --on-variable PWD
|
18
|
-
test -s (basename $PWD)".#{NA.extension}" && na
|
18
|
+
test -s (basename $PWD)".#{NA.extension}" && na next
|
19
19
|
end
|
20
20
|
EOHOOK
|
21
21
|
when :bash
|
22
22
|
<<~EOHOOK
|
23
23
|
# Bash PROMPT_COMMAND for na
|
24
24
|
last_command_was_cd() {
|
25
|
-
[[ $(history 1|sed -e "s/^[ ]*[0-9]*[ ]*//") =~ ^((cd|z|j|jump|g|f|pushd|popd|exit)([ ]|$)) ]] && na
|
25
|
+
[[ $(history 1|sed -e "s/^[ ]*[0-9]*[ ]*//") =~ ^((cd|z|j|jump|g|f|pushd|popd|exit)([ ]|$)) ]] && na next
|
26
26
|
}
|
27
27
|
if [[ -z "$PROMPT_COMMAND" ]]; then
|
28
28
|
PROMPT_COMMAND="eval 'last_command_was_cd'"
|
data/lib/na/version.rb
CHANGED
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.
|
12
|
+
The current version of `na` is <!--VER-->1.0.6<!--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
|
|