hookapp 2.0.3 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/AUTHORS.md +4 -0
  4. data/CHANGELOG.md +5 -0
  5. data/Gemfile.lock +49 -66
  6. data/LICENSE +21 -0
  7. data/README.md +52 -19
  8. data/Rakefile +7 -3
  9. data/bin/hook +114 -78
  10. data/buildnotes.md +30 -0
  11. data/hook.rdoc +35 -11
  12. data/hookapp.gemspec +2 -2
  13. data/html/App.html +6 -18
  14. data/html/GLI/Commands/Doc.html +2 -10
  15. data/html/GLI/Commands/MarkdownDocumentListener.html +34 -230
  16. data/html/GLI/Commands.html +2 -10
  17. data/html/GLI.html +2 -10
  18. data/html/Hook.html +2 -15
  19. data/html/HookApp.html +99 -319
  20. data/html/Hooker.html +46 -24
  21. data/html/README_rdoc.html +49 -23
  22. data/html/String.html +28 -120
  23. data/html/created.rid +8 -8
  24. data/html/css/rdoc.css +21 -1
  25. data/html/index.html +38 -29
  26. data/html/js/navigation.js.gz +0 -0
  27. data/html/js/search_index.js +1 -1
  28. data/html/js/search_index.js.gz +0 -0
  29. data/html/js/searcher.js.gz +0 -0
  30. data/html/table_of_contents.html +33 -77
  31. data/lib/helpers/fuzzyfilefinder +0 -0
  32. data/lib/hook/hookapp.rb +39 -21
  33. data/lib/hook/hooker.rb +5 -2
  34. data/lib/hook/markdown_document_listener.rb +12 -2
  35. data/lib/hook/string.rb +4 -0
  36. data/lib/hook/version.rb +1 -1
  37. data/lib/hook.rb +5 -4
  38. data/test/helpers/hook-helpers.rb +76 -0
  39. data/test/hook_clip_test.rb +24 -0
  40. data/test/hook_clone_test.rb +30 -0
  41. data/test/hook_encode_test.rb +30 -0
  42. data/test/hook_link_test.rb +39 -0
  43. data/test/hook_list_test.rb +25 -0
  44. data/test/hook_remove_test.rb +34 -0
  45. data/test/hook_scripts_test.rb +21 -0
  46. metadata +19 -22
  47. data/test/default_test.rb +0 -14
  48. data/test/hookfiles/01.test +0 -0
  49. data/test/hookfiles/02.test +0 -0
  50. data/test/hookfiles/03.test +0 -0
  51. data/test/hookfiles/04.test +0 -0
  52. data/test/hookfiles/05.test +0 -0
  53. data/test/hookfiles/06.test +0 -0
  54. data/test/hookfiles/07.test +0 -0
  55. data/test/hookfiles/08.test +0 -0
  56. data/test/hookfiles/09.test +0 -0
  57. data/test/hookfiles/10.test +0 -0
  58. data/test/hookfiles/11.test +0 -0
  59. data/test/hookfiles/12.test +0 -0
data/bin/hook CHANGED
@@ -1,15 +1,17 @@
1
- #!/usr/bin/env ruby
1
+ #!/usr/bin/env ruby -W1
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'gli'
5
4
  require 'hook'
5
+ require 'shellwords'
6
6
 
7
7
  # Main class for GLI app
8
8
  class App
9
9
  extend GLI::App
10
10
 
11
11
  program_desc 'CLI interface for Hook.app (macOS)'
12
- program_long_desc 'Hook.app is a productivity tool for macOS <https://hookproductivity.com/>. This gem includes a `hook` binary that allows interaction with the features of Hook.app.'
12
+ program_long_desc 'Hook.app is a productivity tool for macOS <https://hookproductivity.com/>.
13
+
14
+ This gem includes a `hook` binary that allows interaction with the features of Hook.app.'
13
15
  default_command 'help'
14
16
  autocomplete_commands = true
15
17
  synopsis_format(:terminal)
@@ -19,15 +21,14 @@ class App
19
21
  subcommand_option_handling :normal
20
22
  arguments :strict
21
23
 
22
- hooker = nil
24
+ hookapp = nil
25
+ stdin = nil
23
26
 
24
27
  desc 'List hooks on a file or url'
25
- long_desc %{
26
- Output a list of all hooks attached to given url(s) or file(s) in the specified format (default "paths").
27
-
28
- Run `hook list` with no file/url argument to list all bookmarks.}
28
+ long_desc %(Output a list of all hooks attached to given url(s) or file(s) in the specified format (default "paths").
29
29
 
30
- arg_name 'FILE_OR_URL [FILE_OR_URL...]'
30
+ Run `hook list` with no file/url argument to list all bookmarks.)
31
+ arg_name 'FILE_OR_URL', [:optional, :multiple]
31
32
  command %i[list ls] do |c|
32
33
  c.desc 'Generate a menu to select hook(s) for opening'
33
34
  c.long_desc 'This option is a shortcut to `hook select` and overrides any other arguments.'
@@ -42,20 +43,22 @@ Run `hook list` with no file/url argument to list all bookmarks.}
42
43
  valid_formats = %w[hooks paths markdown verbose]
43
44
  fmt_list = valid_formats.map { |fmt| fmt.sub(/^(.)(.*?)$/, '(\1)\2') }.join(', ')
44
45
  c.desc "Output format [#{fmt_list}]"
45
- c.flag %i[o output_format], { arg_name: 'format', default_value: 'paths' }
46
+ c.arg_name 'FORMAT'
47
+ c.flag %i[o output_format], { arg_name: 'FORMAT', default_value: 'paths' }
46
48
 
47
49
  c.action do |_global_options, options, args|
48
50
  if options[:s]
49
- return hooker.open_linked(args[0])
50
- end
51
- valid_format = hooker.validate_format(options[:o], valid_formats)
52
- exit_now!("Invalid output format: \"#{options[:o]}\"", 6) unless valid_format
51
+ hookapp.open_linked(args[0])
52
+ else
53
+ valid_format = hookapp.validate_format(options[:o], valid_formats)
54
+ help_now!("Invalid output format: \"#{options[:o]}\"", 6) unless valid_format
53
55
 
54
- result = hooker.linked_bookmarks(args, { files_only: options[:f],
55
- format: valid_format,
56
- null_separator: options[:null] })
56
+ result = hookapp.linked_bookmarks(args, { files_only: options[:f],
57
+ format: valid_format,
58
+ null_separator: options[:null] })
57
59
 
58
- puts result
60
+ puts result
61
+ end
59
62
  end
60
63
  end
61
64
 
@@ -63,25 +66,21 @@ Run `hook list` with no file/url argument to list all bookmarks.}
63
66
  # the full shell name as the extension, e.g. "hook_completion.bash".
64
67
  desc 'Shell completion examples'
65
68
  valid_shells = %w[bash zsh fish]
66
- long_desc %{
67
- Output completion script example for the specified shell (#{valid_shells.join(', ')})
68
- }
69
+ long_desc %(Output completion script example for the specified shell (#{valid_shells.join(', ')}))
69
70
  arg_name 'SHELL'
70
71
  command %i[scripts] do |c|
71
72
  c.action do |_global_options, _options, args|
72
73
  if args.length > 1
73
- exit_now!("Invalid number of arguments, (expected 1)", 5)
74
+ help_now!('Invalid number of arguments, (expected 1)', 5)
74
75
  elsif args.nil? || args.empty?
75
- exit_now!("Specify a shell (#{valid_shells.join(', ')})", 0)
76
+ help_now!("Specify a shell (#{valid_shells.join(', ')})", 0)
77
+ elsif valid_shells.include?(args[0])
78
+ base_dir = File.expand_path(File.join(File.dirname(__FILE__), '../lib/completion'))
79
+ completion = File.join(base_dir, "hook_completion.#{args[0]}")
80
+ script = IO.read(completion)
81
+ $stdout.puts script
76
82
  else
77
- if valid_shells.include?(args[0])
78
- base_dir = File.expand_path(File.join(File.dirname(__FILE__), '../lib/completion'))
79
- completion = File.join(base_dir, "hook_completion.#{args[0]}")
80
- script = IO.read(completion)
81
- $stdout.puts script
82
- else
83
- exit_now!("Invalid shell name, must be one of #{valid_shells.join(', ')}", 1)
84
- end
83
+ help_now!("Invalid shell name, must be one of #{valid_shells.join(', ')}", 1)
85
84
  end
86
85
  end
87
86
  end
@@ -89,11 +88,10 @@ Output completion script example for the specified shell (#{valid_shells.join(',
89
88
 
90
89
 
91
90
  desc 'Search bookmarks'
92
- long_desc %{
93
- Search bookmark urls and names for a string and output in specified format (default "paths").
91
+ long_desc %(Search bookmark urls and names for a string and output in specified format (default "paths").
94
92
 
95
- Run `hook find` with no search argument to list all bookmarks.}
96
- arg_name 'SEARCH_STRING'
93
+ Run `hook find` with no search argument to list all bookmarks.)
94
+ arg_name 'SEARCH_STRING', :optional
97
95
  command %i[find search] do |c|
98
96
  c.desc 'Output only bookmarks with file paths (exclude e.g. emails)'
99
97
  c.switch %i[f files_only], { negatable: false, default_value: false }
@@ -105,16 +103,16 @@ Run `hook find` with no search argument to list all bookmarks.}
105
103
  fmt_list = valid_formats.map { |fmt| fmt.sub(/^(.)(.*?)$/, '(\1)\2') }.join(', ')
106
104
 
107
105
  c.desc "Output format [#{fmt_list}]"
108
- c.flag %i[o output_format], { arg_name: 'format', default_value: 'paths' }
106
+ c.flag %i[o output_format], { arg_name: 'FORMAT', default_value: 'paths' }
109
107
 
110
108
  c.desc "Search only bookmark names"
111
109
  c.switch %i[n names_only], { negatable: false, default_value: false }
112
110
 
113
111
  c.action do |_global_options, options, args|
114
- valid_format = hooker.validate_format(options[:o], valid_formats)
112
+ valid_format = hookapp.validate_format(options[:o], valid_formats)
115
113
  exit_now!("Invalid output format: \"#{options[:o]}\"", 6) unless valid_format
116
114
 
117
- result = hooker.search_bookmarks(args.join(" "), { files_only: options[:f],
115
+ result = hookapp.search_bookmarks(args.join(" "), { files_only: options[:f],
118
116
  format: valid_format,
119
117
  null_separator: options[:null],
120
118
  names_only: options[:n] })
@@ -124,16 +122,15 @@ Run `hook find` with no search argument to list all bookmarks.}
124
122
  end
125
123
 
126
124
  desc 'Create bidirectional hooks between two or more files/urls'
127
- long_desc %{
128
- If two files/urls are provided, links will be bi-directional.
125
+ long_desc 'If two files/urls are provided, links will be bi-directional.
129
126
  If three or more are provided, `link` defaults to creating bi-directional
130
127
  links between each file and the last file in the list. Use `-a` to create
131
128
  bi-directional links between every file in the list.
132
129
 
133
130
  If using `--paste`, the URL/hook link in the clipboard will be used as one argument,
134
131
  to be combined with one or more file/url arguments.
135
- }
136
- arg_name 'SOURCE [SOURCE...] TARGET'
132
+ '
133
+ arg_name 'SOURCE... TARGET'
137
134
  command %i[link ln] do |c|
138
135
  c.desc 'Link every listed file or url to every other'
139
136
  c.switch %i[a all], { negatable: false, default_value: false }
@@ -151,20 +148,18 @@ to be combined with one or more file/url arguments.
151
148
  exit_now!('Wrong number of arguments. At least 2 files must be specified, or one file with --paste', 5)
152
149
  end
153
150
  if options[:a]
154
- puts hooker.link_all(args)
151
+ puts hookapp.link_all(args)
155
152
  else
156
- puts hooker.link_files(args)
153
+ puts hookapp.link_files(args)
157
154
  end
158
155
  end
159
156
  end
160
157
 
161
158
  desc 'Copy Hook URL for file/url to clipboard'
162
- long_desc %{
163
- Creates a bookmark for the specified file or URL and copies its Hook URL to the clipboard.
159
+ long_desc %{Creates a bookmark for the specified file or URL and copies its Hook URL to the clipboard.
164
160
 
165
- The copied Hook URL can be used to link to other files (use `hook link --paste FILE/URL),
166
- or to paste into another app as a link. Use the -m flag to copy a full Markdown link.
167
- }
161
+ The copied Hook URL can be used to link to other files (use `hook link --paste FILE/URL`,
162
+ or to paste into another app as a link. Use the -m flag to copy a full Markdown link.}
168
163
  arg_name 'FILE_OR_URL'
169
164
  command %i[clip cp] do |c|
170
165
  c.desc 'Copy as Markdown'
@@ -177,20 +172,18 @@ or to paste into another app as a link. Use the -m flag to copy a full Markdown
177
172
  exit_now!('Wrong number of arguments. Requires a path/url or -a APP_NAME', 5) if args.length != 1 && !options[:a]
178
173
 
179
174
  if options[:a]
180
- puts hooker.bookmark_from_app(options[:a], { copy: true, markdown: options[:m] })
175
+ puts hookapp.bookmark_from_app(options[:a], { copy: true, markdown: options[:m] })
181
176
  else
182
- puts hooker.clip_bookmark(args[0], { markdown: options[:m] })
177
+ puts hookapp.clip_bookmark(args[0], { markdown: options[:m] })
183
178
  end
184
179
  end
185
180
  end
186
181
 
187
182
  desc 'Get a Hook URL for the frontmost window of an app'
188
- long_desc %{
189
- Specify an application by name (without '.app') to bring that app to the foreground and create a bookmark
183
+ long_desc %(Specify an application by name (without '.app') to bring that app to the foreground and create a bookmark
190
184
  for the active document, note, task, etc., returning a Hook URL.
191
185
 
192
- Use -m to get the response as Markdown, and/or -c to copy the result directly to the clipboard.
193
- }
186
+ Use -m to get the response as Markdown, and/or -c to copy the result directly to the clipboard.)
194
187
  arg_name 'APPLICATION_NAME'
195
188
  command %i[from] do |c|
196
189
  c.desc 'Output as Markdown'
@@ -202,76 +195,119 @@ Use -m to get the response as Markdown, and/or -c to copy the result directly to
202
195
  c.action do |_global_options, options, args|
203
196
  exit_now!("Wrong number of arguments (1 expected, #{args.length} given)", 5) if args.length != 1
204
197
 
205
- puts hooker.bookmark_from_app(args[0], { copy: options[:c], markdown: options[:m] })
198
+ puts hookapp.bookmark_from_app(args[0], { copy: options[:c], markdown: options[:m] })
206
199
  end
207
200
  end
208
201
 
209
202
  desc 'Remove a hook between two files/urls'
210
- long_desc %{
211
- Remove a hook between two files or URLs. If you use --all, all hooks on a given file will be removed.
203
+ long_desc %(Remove a hook between two files or URLs. If you use --all, all hooks on a given file will be removed.
212
204
 
213
- If --all isn't specified, exactly two arguments (Files/URLs) are required.
214
- }
215
- arg_name 'ITEM_1 ITEM_2'
205
+ If --all isn't specified, exactly two arguments (Files/URLs) are required.)
206
+ arg_name 'FILE_OR_URL', :multiple
216
207
  command %i[remove rm] do |c|
217
208
  c.desc 'Remove ALL links on files, requires confirmation'
218
209
  c.switch %i[a all], { negatable: false, default_value: false }
210
+ c.switch %i[f force], { negatable: false, default_value: false }
219
211
 
220
212
  c.action do |_global_options, options, args|
221
- result = hooker.delete_hooks(args, { all: options[:a] })
213
+ result = hookapp.delete_hooks(args, { all: options[:all], force: options[:force] })
222
214
  puts result
223
215
  end
224
216
  end
225
217
 
226
218
  desc 'Clone all hooks from one file or url onto another'
227
- long_desc %{
228
- Copy all the files and urls that the first file is hooked to onto another file. Exactly two arguments (SOURCE, TARGET) required.
229
- }
219
+ long_desc 'Copy all the files and urls that the first file is hooked to onto another file.
220
+
221
+ Exactly two arguments (SOURCE, TARGET) required.'
230
222
  arg_name 'SOURCE TARGET'
231
223
  command %i[clone] do |c|
232
224
  c.action do |_global_options, _options, args|
233
225
  exit_now!("Wrong number of arguments. Two file paths or urls required (#{args.length} given)", 5) if args.length != 2
234
226
 
235
- result = hooker.clone_hooks(args)
227
+ result = hookapp.clone_hooks(args)
236
228
  puts result
237
229
  end
238
230
  end
239
231
 
240
232
  desc 'Select from hooks on a file/url and open in default application'
241
- long_desc %{
242
- If the target file/URL has hooked items, a menu will be provided. Selecting one or more files
233
+ long_desc %(If the target file/URL has hooked items, a menu will be provided. Selecting one or more files
243
234
  from this menu will open the item(s) using the default application assigned to the
244
- filetype by macOS. Allows multiple selections with tab key, and type-ahead fuzzy filtering of results.
245
- }
235
+ filetype by macOS. Allows multiple selections with tab key, and type-ahead fuzzy filtering of results.)
246
236
  arg_name 'FILE_OR_URL'
247
237
  command %i[select] do |c|
248
238
  c.action do |_global_options, _options, args|
249
- exit_now!("Wrong number of arguments. One file path or url required (#{args.length} given)", 5) if args.length != 1
239
+ help_now!("Wrong number of arguments. One file path or url required (#{args.length} given)", 5) if args.length != 1
250
240
 
251
- hooker.open_linked(args[0])
241
+ hookapp.open_linked(args[0])
252
242
  end
253
243
  end
254
244
 
255
245
  desc 'Open the specified file or url in Hook GUI'
256
- long_desc %{
257
- Opens Hook.app on the specified file/URL for browsing and performing actions. Exactly one argument (File/URL) required.
258
- }
246
+ long_desc 'Opens Hook.app on the specified file/URL for browsing and performing actions.
247
+
248
+ Exactly one argument (File/URL) required.'
259
249
  arg_name 'FILE_OR_URL'
260
250
  command %i[open gui] do |c|
261
251
  c.action do |_global_options, _options, args|
262
- exit_now!("Wrong number of arguments. One file path or url required (#{args.length} given)", 5) if args.length != 1
252
+ if args.length != 1
253
+ help_now!("Wrong number of arguments. One file path
254
+ or url required (#{args.length} given)", 5)
255
+ end
263
256
 
264
- hooker.open_gui(args[0])
257
+ hookapp.open_gui(args[0])
265
258
  end
266
259
  end
267
260
 
261
+ desc 'Percent encode/decode a string'
262
+ long_desc %(Use encode or decode to apply Hook's url encoding to a string argument. Use '-' to read input from STDIN.)
263
+ arg_name 'STRING'
264
+ command :percent do |c|
265
+ c.desc 'percent encode a string'
266
+ c.arg_name 'STRING'
267
+ c.command :encode do |enc|
268
+ enc.action do |_global_options, _options, args|
269
+ if stdin
270
+ string = stdin
271
+ else
272
+ help_now!('No string provided') unless args.size.positive?
273
+
274
+ string = args.join(' ').strip
275
+ end
276
+
277
+ print hookapp.encode(string)
278
+ end
279
+ end
280
+
281
+ c.desc 'decode a percent-encoded string'
282
+ c.arg_name 'STRING'
283
+ c.command :decode do |dec|
284
+ dec.action do |_global_options, _options, args|
285
+ if stdin
286
+ string = stdin
287
+ else
288
+ help_now!('no string provided') unless args.size.positive?
289
+
290
+ string = args.join(' ').strip
291
+ end
292
+
293
+ print hookapp.decode(string)
294
+ end
295
+ end
296
+
297
+ # c.default_command :encode
298
+ end
299
+
268
300
  pre do |global, _command, _options, _args|
269
301
  # Pre logic here
270
302
  # Return true to proceed; false to abort and not call the
271
303
  # chosen command
272
304
  # Use skips_pre before a command to skip this block
273
305
  # on that command only
274
- hooker = Hooker.new
306
+ if !STDIN.tty?
307
+ stdin = STDIN.read.strip
308
+ end
309
+
310
+ hookapp = HookApp.new
275
311
  true
276
312
  end
277
313
 
data/buildnotes.md CHANGED
@@ -27,3 +27,33 @@ Helpers and main classes are in `lib/`.
27
27
  Update the docs with `bundle exec bin/hook _doc --format=markdown` and `bundle exec bin/hook _doc --format=rdoc`, then run `rake rerdoc`
28
28
 
29
29
  @run(bundle exec bin/hook _doc --format=rdoc && bundle exec bin/hook _doc --format=markdown && rake rerdoc)
30
+
31
+ ## Test
32
+
33
+ Run all tests using `rake test`.
34
+
35
+ Run verbose using `rake test TESTOPT="-v"`
36
+
37
+ Run a single test using `rake test TEST=test/TEST_FILE.rb`
38
+
39
+ This howzit task accepts an optional argument pointing to a specific test (just the test part of the filename, e.g. archive runs `test/doing_archive_test.rb`).
40
+
41
+ `howzit -r test -- archive` (or `bld test archive` with the Fish function)
42
+
43
+ ```run
44
+ #!/bin/bash
45
+ if [[ -n $1 ]]; then
46
+ rake test TESTOPT="-v" TEST=test/hook_$1_test.rb
47
+ if [[ $? != 0 ]]; then
48
+ echo "Available tests"
49
+ echo -e "\033[1;32;40m"
50
+ FILES="test/hook_*_test.rb"
51
+ for file in $FILES; do
52
+ echo $(basename $file ".rb") | sed -E 's/hook_(.*)_test/- \1/'
53
+ done
54
+ echo -e "\033[0m"
55
+ fi
56
+ else
57
+ rake test TESTOPT="-v"
58
+ fi
59
+ ```
data/hook.rdoc CHANGED
@@ -1,8 +1,10 @@
1
1
  == hook - CLI interface for Hook.app (macOS)
2
2
 
3
- Hook.app is a productivity tool for macOS <https://hookproductivity.com/>. This gem includes a `hook` binary that allows interaction with the features of Hook.app.
3
+ Hook.app is a productivity tool for macOS <https://hookproductivity.com/>.
4
4
 
5
- v2.0.3
5
+ This gem includes a `hook` binary that allows interaction with the features of Hook.app.
6
+
7
+ v2.0.7
6
8
 
7
9
  === Global Options
8
10
  === --help
@@ -21,7 +23,7 @@ Copy Hook URL for file/url to clipboard
21
23
 
22
24
  Creates a bookmark for the specified file or URL and copies its Hook URL to the clipboard.
23
25
 
24
- The copied Hook URL can be used to link to other files (use `hook link --paste FILE/URL),
26
+ The copied Hook URL can be used to link to other files (use `hook link --paste FILE/URL`,
25
27
  or to paste into another app as a link. Use the -m flag to copy a full Markdown link.
26
28
  ===== Options
27
29
  ===== -a|--app APP_NAME
@@ -39,15 +41,17 @@ Copy as Markdown
39
41
  ==== Command: <tt>clone SOURCE TARGET</tt>
40
42
  Clone all hooks from one file or url onto another
41
43
 
42
- Copy all the files and urls that the first file is hooked to onto another file. Exactly two arguments (SOURCE, TARGET) required.
43
- ==== Command: <tt>find|search SEARCH_STRING</tt>
44
+ Copy all the files and urls that the first file is hooked to onto another file.
45
+
46
+ Exactly two arguments (SOURCE, TARGET) required.
47
+ ==== Command: <tt>find|search [SEARCH_STRING]</tt>
44
48
  Search bookmarks
45
49
 
46
50
  Search bookmark urls and names for a string and output in specified format (default "paths").
47
51
 
48
52
  Run `hook find` with no search argument to list all bookmarks.
49
53
  ===== Options
50
- ===== -o|--output_format format
54
+ ===== -o|--output_format FORMAT
51
55
 
52
56
  Output format [(h)ooks, (p)aths, (m)arkdown, (v)erbose]
53
57
 
@@ -97,7 +101,7 @@ List commands one per line, to assist with shell completion
97
101
 
98
102
 
99
103
 
100
- ==== Command: <tt>link|ln SOURCE [SOURCE...] TARGET</tt>
104
+ ==== Command: <tt>link|ln SOURCE... TARGET</tt>
101
105
  Create bidirectional hooks between two or more files/urls
102
106
 
103
107
  If two files/urls are provided, links will be bi-directional.
@@ -118,14 +122,14 @@ Paste URL from clipboard
118
122
 
119
123
 
120
124
 
121
- ==== Command: <tt>list|ls FILE_OR_URL [FILE_OR_URL...]</tt>
125
+ ==== Command: <tt>list|ls [FILE_OR_URL]...</tt>
122
126
  List hooks on a file or url
123
127
 
124
128
  Output a list of all hooks attached to given url(s) or file(s) in the specified format (default "paths").
125
129
 
126
130
  Run `hook list` with no file/url argument to list all bookmarks.
127
131
  ===== Options
128
- ===== -o|--output_format format
132
+ ===== -o|--output_format FORMAT
129
133
 
130
134
  Output format [(h)ooks, (p)aths, (m)arkdown, (v)erbose]
131
135
 
@@ -150,8 +154,23 @@ This option is a shortcut to `hook select` and overrides any other arguments.
150
154
  ==== Command: <tt>open|gui FILE_OR_URL</tt>
151
155
  Open the specified file or url in Hook GUI
152
156
 
153
- Opens Hook.app on the specified file/URL for browsing and performing actions. Exactly one argument (File/URL) required.
154
- ==== Command: <tt>remove|rm ITEM_1 ITEM_2</tt>
157
+ Opens Hook.app on the specified file/URL for browsing and performing actions.
158
+
159
+ Exactly one argument (File/URL) required.
160
+ ==== Command: <tt>percent STRING</tt>
161
+ Percent encode/decode a string
162
+
163
+ Use encode or decode to apply Hook's url encoding to a string argument. Use '-' to read input from STDIN.
164
+ ===== Commands
165
+ ====== Command: <tt>decode STRING</tt>
166
+ decode a percent-encoded string
167
+
168
+
169
+ ====== Command: <tt>encode STRING</tt>
170
+ percent encode a string
171
+
172
+
173
+ ==== Command: <tt>remove|rm FILE_OR_URL...</tt>
155
174
  Remove a hook between two files/urls
156
175
 
157
176
  Remove a hook between two files or URLs. If you use --all, all hooks on a given file will be removed.
@@ -163,6 +182,11 @@ Remove ALL links on files, requires confirmation
163
182
 
164
183
 
165
184
 
185
+ ===== -f|--force
186
+
187
+
188
+
189
+
166
190
  ==== Command: <tt>scripts SHELL</tt>
167
191
  Shell completion examples
168
192
 
data/hookapp.gemspec CHANGED
@@ -18,6 +18,6 @@ Gem::Specification.new do |s|
18
18
  s.executables << 'hook'
19
19
  s.add_development_dependency('aruba', '~> 0.14.14')
20
20
  s.add_development_dependency('rake', '~> 13.0.1')
21
- s.add_development_dependency('rdoc', '~> 6.1.2')
22
- s.add_runtime_dependency('gli', '2.19.0')
21
+ s.add_development_dependency('rdoc', '~> 6.3.2')
22
+ s.add_runtime_dependency('gli', '~> 2.20.1')
23
23
  end
data/html/App.html CHANGED
@@ -21,8 +21,6 @@
21
21
  <link href="./css/rdoc.css" rel="stylesheet">
22
22
 
23
23
 
24
-
25
-
26
24
  <body id="top" role="document" class="class">
27
25
  <nav role="navigation">
28
26
  <div id="project-navigation">
@@ -59,24 +57,20 @@
59
57
 
60
58
  <div id="class-metadata">
61
59
 
62
- <div id="parent-class-section" class="nav-section">
60
+
61
+ <div id="parent-class-section" class="nav-section">
63
62
  <h3>Parent</h3>
64
63
 
65
-
66
64
  <p class="link">Object
67
-
68
65
  </div>
69
66
 
70
67
 
71
- <div id="extends-section" class="nav-section">
68
+
69
+ <div id="extends-section" class="nav-section">
72
70
  <h3>Extended With Modules</h3>
73
71
 
74
72
  <ul class="link-list">
75
-
76
-
77
73
  <li><span class="extend">GLI::App</span>
78
-
79
-
80
74
  </ul>
81
75
  </div>
82
76
 
@@ -95,25 +89,19 @@
95
89
 
96
90
  </section>
97
91
 
98
-
99
92
  <section id="5Buntitled-5D" class="documentation-section">
100
-
101
93
 
102
-
103
94
 
104
-
105
95
 
106
-
107
96
 
108
-
109
- </section>
110
97
 
98
+ </section>
111
99
  </main>
112
100
 
113
101
 
114
102
  <footer id="validator-badges" role="contentinfo">
115
103
  <p><a href="https://validator.w3.org/check/referer">Validate</a>
116
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.1.
104
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.2.
117
105
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
118
106
  </footer>
119
107
 
@@ -21,8 +21,6 @@
21
21
  <link href="../../css/rdoc.css" rel="stylesheet">
22
22
 
23
23
 
24
-
25
-
26
24
  <body id="top" role="document" class="module">
27
25
  <nav role="navigation">
28
26
  <div id="project-navigation">
@@ -75,25 +73,19 @@
75
73
 
76
74
  </section>
77
75
 
78
-
79
76
  <section id="5Buntitled-5D" class="documentation-section">
80
-
81
77
 
82
-
83
78
 
84
-
85
79
 
86
-
87
80
 
88
-
89
- </section>
90
81
 
82
+ </section>
91
83
  </main>
92
84
 
93
85
 
94
86
  <footer id="validator-badges" role="contentinfo">
95
87
  <p><a href="https://validator.w3.org/check/referer">Validate</a>
96
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.1.
88
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.2.
97
89
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
98
90
  </footer>
99
91