hookapp 0.0.5 → 2.0.4
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 +4 -4
- data/.gitignore +3 -0
- data/CHANGELOG.md +32 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +51 -34
- data/LICENSE.md +31 -0
- data/OVERVIEW.md +80 -0
- data/README.md +283 -37
- data/Rakefile +1 -1
- data/bin/hook +140 -24
- data/buildnotes.md +29 -0
- data/hook.rdoc +65 -6
- data/hookapp.gemspec +9 -8
- data/html/App.html +107 -0
- data/html/GLI/Commands/Doc.html +91 -0
- data/html/GLI/Commands/MarkdownDocumentListener.html +511 -0
- data/html/GLI/Commands.html +91 -0
- data/html/GLI.html +91 -0
- data/html/Hook.html +100 -0
- data/html/HookApp.html +946 -0
- data/html/Hooker.html +141 -0
- data/html/README_rdoc.html +325 -0
- data/html/String.html +313 -0
- data/html/created.rid +9 -0
- data/html/css/fonts.css +167 -0
- data/html/css/rdoc.css +639 -0
- data/html/fonts/Lato-Light.ttf +0 -0
- data/html/fonts/Lato-LightItalic.ttf +0 -0
- data/html/fonts/Lato-Regular.ttf +0 -0
- data/html/fonts/Lato-RegularItalic.ttf +0 -0
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/images/add.png +0 -0
- data/html/images/arrow_up.png +0 -0
- data/html/images/brick.png +0 -0
- data/html/images/brick_link.png +0 -0
- data/html/images/bug.png +0 -0
- data/html/images/bullet_black.png +0 -0
- data/html/images/bullet_toggle_minus.png +0 -0
- data/html/images/bullet_toggle_plus.png +0 -0
- data/html/images/date.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/find.png +0 -0
- data/html/images/loadingAnimation.gif +0 -0
- data/html/images/macFFBgHack.png +0 -0
- data/html/images/package.png +0 -0
- data/html/images/page_green.png +0 -0
- data/html/images/page_white_text.png +0 -0
- data/html/images/page_white_width.png +0 -0
- data/html/images/plugin.png +0 -0
- data/html/images/ruby.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/images/tag_green.png +0 -0
- data/html/images/transparent.png +0 -0
- data/html/images/wrench.png +0 -0
- data/html/images/wrench_orange.png +0 -0
- data/html/images/zoom.png +0 -0
- data/html/index.html +293 -0
- data/html/js/darkfish.js +84 -0
- data/html/js/navigation.js +105 -0
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +110 -0
- data/html/js/search_index.js +1 -0
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +229 -0
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +345 -0
- data/lib/completion/hook_completion.bash +22 -0
- data/lib/completion/hook_completion.fish +31 -0
- data/lib/completion/hook_completion.zsh +22 -0
- data/lib/helpers/fuzzyfilefinder +0 -0
- data/lib/hook/hookapp.rb +489 -0
- data/lib/hook/hooker.rb +4 -344
- data/lib/hook/markdown_document_listener.rb +164 -0
- data/lib/hook/string.rb +60 -0
- data/lib/hook/version.rb +3 -1
- data/lib/hook.rb +7 -2
- metadata +87 -22
data/bin/hook
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
|
-
require 'gli'
|
|
5
4
|
require 'hook'
|
|
6
5
|
|
|
7
6
|
# Main class for GLI app
|
|
@@ -9,17 +8,30 @@ class App
|
|
|
9
8
|
extend GLI::App
|
|
10
9
|
|
|
11
10
|
program_desc 'CLI interface for Hook.app (macOS)'
|
|
11
|
+
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
|
+
default_command 'help'
|
|
13
|
+
autocomplete_commands = true
|
|
14
|
+
synopsis_format(:terminal)
|
|
12
15
|
|
|
13
16
|
version Hook::VERSION
|
|
14
17
|
|
|
15
18
|
subcommand_option_handling :normal
|
|
16
19
|
arguments :strict
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
hookapp = nil
|
|
19
22
|
|
|
20
23
|
desc 'List hooks on a file or url'
|
|
24
|
+
long_desc %{
|
|
25
|
+
Output a list of all hooks attached to given url(s) or file(s) in the specified format (default "paths").
|
|
26
|
+
|
|
27
|
+
Run `hook list` with no file/url argument to list all bookmarks.}
|
|
28
|
+
|
|
21
29
|
arg_name 'FILE_OR_URL [FILE_OR_URL...]'
|
|
22
30
|
command %i[list ls] do |c|
|
|
31
|
+
c.desc 'Generate a menu to select hook(s) for opening'
|
|
32
|
+
c.long_desc 'This option is a shortcut to `hook select` and overrides any other arguments.'
|
|
33
|
+
c.switch %i[s select]
|
|
34
|
+
|
|
23
35
|
c.desc 'Output only bookmarks with file paths (exclude e.g. emails)'
|
|
24
36
|
c.switch %i[f files_only], { negatable: false, default_value: false }
|
|
25
37
|
|
|
@@ -32,10 +44,13 @@ class App
|
|
|
32
44
|
c.flag %i[o output_format], { arg_name: 'format', default_value: 'paths' }
|
|
33
45
|
|
|
34
46
|
c.action do |_global_options, options, args|
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
if options[:s]
|
|
48
|
+
return hookapp.open_linked(args[0])
|
|
49
|
+
end
|
|
50
|
+
valid_format = hookapp.validate_format(options[:o], valid_formats)
|
|
51
|
+
exit_now!("Invalid output format: \"#{options[:o]}\"", 6) unless valid_format
|
|
37
52
|
|
|
38
|
-
result =
|
|
53
|
+
result = hookapp.linked_bookmarks(args, { files_only: options[:f],
|
|
39
54
|
format: valid_format,
|
|
40
55
|
null_separator: options[:null] })
|
|
41
56
|
|
|
@@ -43,7 +58,80 @@ class App
|
|
|
43
58
|
end
|
|
44
59
|
end
|
|
45
60
|
|
|
61
|
+
# Shell completion scripts are located in lib/completion/ and named "hook_completion" with
|
|
62
|
+
# the full shell name as the extension, e.g. "hook_completion.bash".
|
|
63
|
+
desc 'Shell completion examples'
|
|
64
|
+
valid_shells = %w[bash zsh fish]
|
|
65
|
+
long_desc %{
|
|
66
|
+
Output completion script example for the specified shell (#{valid_shells.join(', ')})
|
|
67
|
+
}
|
|
68
|
+
arg_name 'SHELL'
|
|
69
|
+
command %i[scripts] do |c|
|
|
70
|
+
c.action do |_global_options, _options, args|
|
|
71
|
+
if args.length > 1
|
|
72
|
+
exit_now!("Invalid number of arguments, (expected 1)", 5)
|
|
73
|
+
elsif args.nil? || args.empty?
|
|
74
|
+
exit_now!("Specify a shell (#{valid_shells.join(', ')})", 0)
|
|
75
|
+
else
|
|
76
|
+
if valid_shells.include?(args[0])
|
|
77
|
+
base_dir = File.expand_path(File.join(File.dirname(__FILE__), '../lib/completion'))
|
|
78
|
+
completion = File.join(base_dir, "hook_completion.#{args[0]}")
|
|
79
|
+
script = IO.read(completion)
|
|
80
|
+
$stdout.puts script
|
|
81
|
+
else
|
|
82
|
+
exit_now!("Invalid shell name, must be one of #{valid_shells.join(', ')}", 1)
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
desc 'Search bookmarks'
|
|
91
|
+
long_desc %{
|
|
92
|
+
Search bookmark urls and names for a string and output in specified format (default "paths").
|
|
93
|
+
|
|
94
|
+
Run `hook find` with no search argument to list all bookmarks.}
|
|
95
|
+
arg_name 'SEARCH_STRING'
|
|
96
|
+
command %i[find search] do |c|
|
|
97
|
+
c.desc 'Output only bookmarks with file paths (exclude e.g. emails)'
|
|
98
|
+
c.switch %i[f files_only], { negatable: false, default_value: false }
|
|
99
|
+
|
|
100
|
+
c.desc 'Separate results with NULL separator, only applies with "paths" output for single file argument'
|
|
101
|
+
c.switch %i[null], { negatable: false, default_value: false }
|
|
102
|
+
|
|
103
|
+
valid_formats = %w[hooks paths markdown verbose]
|
|
104
|
+
fmt_list = valid_formats.map { |fmt| fmt.sub(/^(.)(.*?)$/, '(\1)\2') }.join(', ')
|
|
105
|
+
|
|
106
|
+
c.desc "Output format [#{fmt_list}]"
|
|
107
|
+
c.flag %i[o output_format], { arg_name: 'format', default_value: 'paths' }
|
|
108
|
+
|
|
109
|
+
c.desc "Search only bookmark names"
|
|
110
|
+
c.switch %i[n names_only], { negatable: false, default_value: false }
|
|
111
|
+
|
|
112
|
+
c.action do |_global_options, options, args|
|
|
113
|
+
valid_format = hookapp.validate_format(options[:o], valid_formats)
|
|
114
|
+
exit_now!("Invalid output format: \"#{options[:o]}\"", 6) unless valid_format
|
|
115
|
+
|
|
116
|
+
result = hookapp.search_bookmarks(args.join(" "), { files_only: options[:f],
|
|
117
|
+
format: valid_format,
|
|
118
|
+
null_separator: options[:null],
|
|
119
|
+
names_only: options[:n] })
|
|
120
|
+
|
|
121
|
+
puts result
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
46
125
|
desc 'Create bidirectional hooks between two or more files/urls'
|
|
126
|
+
long_desc %{
|
|
127
|
+
If two files/urls are provided, links will be bi-directional.
|
|
128
|
+
If three or more are provided, `link` defaults to creating bi-directional
|
|
129
|
+
links between each file and the last file in the list. Use `-a` to create
|
|
130
|
+
bi-directional links between every file in the list.
|
|
131
|
+
|
|
132
|
+
If using `--paste`, the URL/hook link in the clipboard will be used as one argument,
|
|
133
|
+
to be combined with one or more file/url arguments.
|
|
134
|
+
}
|
|
47
135
|
arg_name 'SOURCE [SOURCE...] TARGET'
|
|
48
136
|
command %i[link ln] do |c|
|
|
49
137
|
c.desc 'Link every listed file or url to every other'
|
|
@@ -59,19 +147,25 @@ class App
|
|
|
59
147
|
args.push(clipboard) if clipboard
|
|
60
148
|
end
|
|
61
149
|
if args.length < 2
|
|
62
|
-
|
|
150
|
+
exit_now!('Wrong number of arguments. At least 2 files must be specified, or one file with --paste', 5)
|
|
63
151
|
end
|
|
64
152
|
if options[:a]
|
|
65
|
-
puts
|
|
153
|
+
puts hookapp.link_all(args)
|
|
66
154
|
else
|
|
67
|
-
puts
|
|
155
|
+
puts hookapp.link_files(args)
|
|
68
156
|
end
|
|
69
157
|
end
|
|
70
158
|
end
|
|
71
159
|
|
|
72
160
|
desc 'Copy Hook URL for file/url to clipboard'
|
|
161
|
+
long_desc %{
|
|
162
|
+
Creates a bookmark for the specified file or URL and copies its Hook URL to the clipboard.
|
|
163
|
+
|
|
164
|
+
The copied Hook URL can be used to link to other files (use `hook link --paste FILE/URL),
|
|
165
|
+
or to paste into another app as a link. Use the -m flag to copy a full Markdown link.
|
|
166
|
+
}
|
|
73
167
|
arg_name 'FILE_OR_URL'
|
|
74
|
-
command %i[clip] do |c|
|
|
168
|
+
command %i[clip cp] do |c|
|
|
75
169
|
c.desc 'Copy as Markdown'
|
|
76
170
|
c.switch %i[m markdown], { negatable: false, default_value: false }
|
|
77
171
|
|
|
@@ -79,17 +173,23 @@ class App
|
|
|
79
173
|
c.flag %i[a app], { arg_name: 'APP_NAME' }
|
|
80
174
|
|
|
81
175
|
c.action do |_global_options, options, args|
|
|
82
|
-
|
|
176
|
+
exit_now!('Wrong number of arguments. Requires a path/url or -a APP_NAME', 5) if args.length != 1 && !options[:a]
|
|
83
177
|
|
|
84
178
|
if options[:a]
|
|
85
|
-
puts
|
|
179
|
+
puts hookapp.bookmark_from_app(options[:a], { copy: true, markdown: options[:m] })
|
|
86
180
|
else
|
|
87
|
-
puts
|
|
181
|
+
puts hookapp.clip_bookmark(args[0], { markdown: options[:m] })
|
|
88
182
|
end
|
|
89
183
|
end
|
|
90
184
|
end
|
|
91
185
|
|
|
92
186
|
desc 'Get a Hook URL for the frontmost window of an app'
|
|
187
|
+
long_desc %{
|
|
188
|
+
Specify an application by name (without '.app') to bring that app to the foreground and create a bookmark
|
|
189
|
+
for the active document, note, task, etc., returning a Hook URL.
|
|
190
|
+
|
|
191
|
+
Use -m to get the response as Markdown, and/or -c to copy the result directly to the clipboard.
|
|
192
|
+
}
|
|
93
193
|
arg_name 'APPLICATION_NAME'
|
|
94
194
|
command %i[from] do |c|
|
|
95
195
|
c.desc 'Output as Markdown'
|
|
@@ -99,52 +199,68 @@ class App
|
|
|
99
199
|
c.switch %i[c copy], { negatable: false, default_value: false }
|
|
100
200
|
|
|
101
201
|
c.action do |_global_options, options, args|
|
|
102
|
-
|
|
202
|
+
exit_now!("Wrong number of arguments (1 expected, #{args.length} given)", 5) if args.length != 1
|
|
103
203
|
|
|
104
|
-
puts
|
|
204
|
+
puts hookapp.bookmark_from_app(args[0], { copy: options[:c], markdown: options[:m] })
|
|
105
205
|
end
|
|
106
206
|
end
|
|
107
207
|
|
|
108
208
|
desc 'Remove a hook between two files/urls'
|
|
209
|
+
long_desc %{
|
|
210
|
+
Remove a hook between two files or URLs. If you use --all, all hooks on a given file will be removed.
|
|
211
|
+
|
|
212
|
+
If --all isn't specified, exactly two arguments (Files/URLs) are required.
|
|
213
|
+
}
|
|
109
214
|
arg_name 'ITEM_1 ITEM_2'
|
|
110
215
|
command %i[remove rm] do |c|
|
|
111
216
|
c.desc 'Remove ALL links on files, requires confirmation'
|
|
112
|
-
c.switch %i[a all]
|
|
217
|
+
c.switch %i[a all], { negatable: false, default_value: false }
|
|
113
218
|
|
|
114
219
|
c.action do |_global_options, options, args|
|
|
115
|
-
result =
|
|
220
|
+
result = hookapp.delete_hooks(args, { all: options[:a] })
|
|
116
221
|
puts result
|
|
117
222
|
end
|
|
118
223
|
end
|
|
119
224
|
|
|
120
225
|
desc 'Clone all hooks from one file or url onto another'
|
|
226
|
+
long_desc %{
|
|
227
|
+
Copy all the files and urls that the first file is hooked to onto another file. Exactly two arguments (SOURCE, TARGET) required.
|
|
228
|
+
}
|
|
121
229
|
arg_name 'SOURCE TARGET'
|
|
122
|
-
command %i[clone
|
|
230
|
+
command %i[clone] do |c|
|
|
123
231
|
c.action do |_global_options, _options, args|
|
|
124
|
-
|
|
232
|
+
exit_now!("Wrong number of arguments. Two file paths or urls required (#{args.length} given)", 5) if args.length != 2
|
|
125
233
|
|
|
126
|
-
result =
|
|
234
|
+
result = hookapp.clone_hooks(args)
|
|
127
235
|
puts result
|
|
128
236
|
end
|
|
129
237
|
end
|
|
130
238
|
|
|
131
239
|
desc 'Select from hooks on a file/url and open in default application'
|
|
240
|
+
long_desc %{
|
|
241
|
+
If the target file/URL has hooked items, a menu will be provided. Selecting one or more files
|
|
242
|
+
from this menu will open the item(s) using the default application assigned to the
|
|
243
|
+
filetype by macOS. Allows multiple selections with tab key, and type-ahead fuzzy filtering of results.
|
|
244
|
+
}
|
|
132
245
|
arg_name 'FILE_OR_URL'
|
|
133
246
|
command %i[select] do |c|
|
|
134
247
|
c.action do |_global_options, _options, args|
|
|
135
|
-
|
|
248
|
+
exit_now!("Wrong number of arguments. One file path or url required (#{args.length} given)", 5) if args.length != 1
|
|
136
249
|
|
|
137
|
-
|
|
250
|
+
hookapp.open_linked(args[0])
|
|
138
251
|
end
|
|
139
252
|
end
|
|
140
253
|
|
|
141
254
|
desc 'Open the specified file or url in Hook GUI'
|
|
255
|
+
long_desc %{
|
|
256
|
+
Opens Hook.app on the specified file/URL for browsing and performing actions. Exactly one argument (File/URL) required.
|
|
257
|
+
}
|
|
142
258
|
arg_name 'FILE_OR_URL'
|
|
143
259
|
command %i[open gui] do |c|
|
|
144
260
|
c.action do |_global_options, _options, args|
|
|
145
|
-
|
|
261
|
+
exit_now!("Wrong number of arguments. One file path or url required (#{args.length} given)", 5) if args.length != 1
|
|
146
262
|
|
|
147
|
-
|
|
263
|
+
hookapp.open_gui(args[0])
|
|
148
264
|
end
|
|
149
265
|
end
|
|
150
266
|
|
|
@@ -154,7 +270,7 @@ class App
|
|
|
154
270
|
# chosen command
|
|
155
271
|
# Use skips_pre before a command to skip this block
|
|
156
272
|
# on that command only
|
|
157
|
-
|
|
273
|
+
hookapp = HookApp.new
|
|
158
274
|
true
|
|
159
275
|
end
|
|
160
276
|
|
data/buildnotes.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# hookapp
|
|
2
|
+
|
|
3
|
+
Hook.app CLI
|
|
4
|
+
|
|
5
|
+
## Editing
|
|
6
|
+
|
|
7
|
+
Main executable is located in `bin/hook`. All commands are defined here.
|
|
8
|
+
|
|
9
|
+
Helpers and main classes are in `lib/`.
|
|
10
|
+
|
|
11
|
+
@run(subl -p hookapp.sublime-project)
|
|
12
|
+
|
|
13
|
+
## Building the Gem
|
|
14
|
+
|
|
15
|
+
@run(rake clobber rdoc package)
|
|
16
|
+
|
|
17
|
+
## Deploy
|
|
18
|
+
|
|
19
|
+
1. Bump version
|
|
20
|
+
2. Commit and push to GitHub
|
|
21
|
+
3. See Updating the Docs
|
|
22
|
+
4. Package the gem (See Building the Gem)
|
|
23
|
+
5. Push the gem with `gem push pkg/hookapp-[VERSION].gem`
|
|
24
|
+
|
|
25
|
+
## Updating the Docs
|
|
26
|
+
|
|
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
|
+
|
|
29
|
+
@run(bundle exec bin/hook _doc --format=rdoc && bundle exec bin/hook _doc --format=markdown && rake rerdoc)
|
data/hook.rdoc
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
== hook - CLI interface for Hook.app (macOS)
|
|
2
2
|
|
|
3
|
-
|
|
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.
|
|
4
|
+
|
|
5
|
+
v2.0.3
|
|
4
6
|
|
|
5
7
|
=== Global Options
|
|
6
8
|
=== --help
|
|
@@ -14,10 +16,13 @@ Display the program version
|
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
=== Commands
|
|
17
|
-
==== Command: <tt>clip FILE_OR_URL</tt>
|
|
19
|
+
==== Command: <tt>clip|cp FILE_OR_URL</tt>
|
|
18
20
|
Copy Hook URL for file/url to clipboard
|
|
19
21
|
|
|
22
|
+
Creates a bookmark for the specified file or URL and copies its Hook URL to the clipboard.
|
|
20
23
|
|
|
24
|
+
The copied Hook URL can be used to link to other files (use `hook link --paste FILE/URL),
|
|
25
|
+
or to paste into another app as a link. Use the -m flag to copy a full Markdown link.
|
|
21
26
|
===== Options
|
|
22
27
|
===== -a|--app APP_NAME
|
|
23
28
|
|
|
@@ -31,14 +36,46 @@ Copy as Markdown
|
|
|
31
36
|
|
|
32
37
|
|
|
33
38
|
|
|
34
|
-
==== Command: <tt>clone
|
|
39
|
+
==== Command: <tt>clone SOURCE TARGET</tt>
|
|
35
40
|
Clone all hooks from one file or url onto another
|
|
36
41
|
|
|
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
|
+
Search bookmarks
|
|
45
|
+
|
|
46
|
+
Search bookmark urls and names for a string and output in specified format (default "paths").
|
|
47
|
+
|
|
48
|
+
Run `hook find` with no search argument to list all bookmarks.
|
|
49
|
+
===== Options
|
|
50
|
+
===== -o|--output_format format
|
|
51
|
+
|
|
52
|
+
Output format [(h)ooks, (p)aths, (m)arkdown, (v)erbose]
|
|
53
|
+
|
|
54
|
+
[Default Value] paths
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
===== -f|--files_only
|
|
58
|
+
Output only bookmarks with file paths (exclude e.g. emails)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
===== -n|--names_only
|
|
63
|
+
Search only bookmark names
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
===== --null
|
|
68
|
+
Separate results with NULL separator, only applies with "paths" output for single file argument
|
|
69
|
+
|
|
70
|
+
|
|
37
71
|
|
|
38
72
|
==== Command: <tt>from APPLICATION_NAME</tt>
|
|
39
73
|
Get a Hook URL for the frontmost window of an app
|
|
40
74
|
|
|
75
|
+
Specify an application by name (without '.app') to bring that app to the foreground and create a bookmark
|
|
76
|
+
for the active document, note, task, etc., returning a Hook URL.
|
|
41
77
|
|
|
78
|
+
Use -m to get the response as Markdown, and/or -c to copy the result directly to the clipboard.
|
|
42
79
|
===== Options
|
|
43
80
|
===== -c|--copy
|
|
44
81
|
Copy to clipboard
|
|
@@ -63,7 +100,13 @@ List commands one per line, to assist with shell completion
|
|
|
63
100
|
==== Command: <tt>link|ln SOURCE [SOURCE...] TARGET</tt>
|
|
64
101
|
Create bidirectional hooks between two or more files/urls
|
|
65
102
|
|
|
103
|
+
If two files/urls are provided, links will be bi-directional.
|
|
104
|
+
If three or more are provided, `link` defaults to creating bi-directional
|
|
105
|
+
links between each file and the last file in the list. Use `-a` to create
|
|
106
|
+
bi-directional links between every file in the list.
|
|
66
107
|
|
|
108
|
+
If using `--paste`, the URL/hook link in the clipboard will be used as one argument,
|
|
109
|
+
to be combined with one or more file/url arguments.
|
|
67
110
|
===== Options
|
|
68
111
|
===== -a|--all
|
|
69
112
|
Link every listed file or url to every other
|
|
@@ -78,7 +121,9 @@ Paste URL from clipboard
|
|
|
78
121
|
==== Command: <tt>list|ls FILE_OR_URL [FILE_OR_URL...]</tt>
|
|
79
122
|
List hooks on a file or url
|
|
80
123
|
|
|
124
|
+
Output a list of all hooks attached to given url(s) or file(s) in the specified format (default "paths").
|
|
81
125
|
|
|
126
|
+
Run `hook list` with no file/url argument to list all bookmarks.
|
|
82
127
|
===== Options
|
|
83
128
|
===== -o|--output_format format
|
|
84
129
|
|
|
@@ -97,21 +142,35 @@ Separate results with NULL separator, only applies with "paths" output for singl
|
|
|
97
142
|
|
|
98
143
|
|
|
99
144
|
|
|
145
|
+
===== -s|--[no-]select
|
|
146
|
+
Generate a menu to select hook(s) for opening
|
|
147
|
+
|
|
148
|
+
This option is a shortcut to `hook select` and overrides any other arguments.
|
|
149
|
+
|
|
100
150
|
==== Command: <tt>open|gui FILE_OR_URL</tt>
|
|
101
151
|
Open the specified file or url in Hook GUI
|
|
102
152
|
|
|
103
|
-
|
|
153
|
+
Opens Hook.app on the specified file/URL for browsing and performing actions. Exactly one argument (File/URL) required.
|
|
104
154
|
==== Command: <tt>remove|rm ITEM_1 ITEM_2</tt>
|
|
105
155
|
Remove a hook between two files/urls
|
|
106
156
|
|
|
157
|
+
Remove a hook between two files or URLs. If you use --all, all hooks on a given file will be removed.
|
|
107
158
|
|
|
159
|
+
If --all isn't specified, exactly two arguments (Files/URLs) are required.
|
|
108
160
|
===== Options
|
|
109
|
-
===== -a|--
|
|
161
|
+
===== -a|--all
|
|
110
162
|
Remove ALL links on files, requires confirmation
|
|
111
163
|
|
|
112
164
|
|
|
113
165
|
|
|
166
|
+
==== Command: <tt>scripts SHELL</tt>
|
|
167
|
+
Shell completion examples
|
|
168
|
+
|
|
169
|
+
Output completion script example for the specified shell (bash, zsh, fish)
|
|
114
170
|
==== Command: <tt>select FILE_OR_URL</tt>
|
|
115
171
|
Select from hooks on a file/url and open in default application
|
|
116
172
|
|
|
117
|
-
|
|
173
|
+
If the target file/URL has hooked items, a menu will be provided. Selecting one or more files
|
|
174
|
+
from this menu will open the item(s) using the default application assigned to the
|
|
175
|
+
filetype by macOS. Allows multiple selections with tab key, and type-ahead fuzzy filtering of results.
|
|
176
|
+
[Default Command] help
|
data/hookapp.gemspec
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Ensure we require the local version and not one we might have installed already
|
|
2
4
|
require File.join([File.dirname(__FILE__), 'lib', 'hook', 'version.rb'])
|
|
3
|
-
|
|
5
|
+
Gem::Specification.new do |s|
|
|
4
6
|
s.name = 'hookapp'
|
|
5
7
|
s.version = Hook::VERSION
|
|
6
8
|
s.author = 'Brett Terpstra'
|
|
@@ -8,15 +10,14 @@ spec = Gem::Specification.new do |s|
|
|
|
8
10
|
s.homepage = 'https://brettterpstra.com'
|
|
9
11
|
s.platform = Gem::Platform::RUBY
|
|
10
12
|
s.summary = 'A CLI for Hook.app (macOS)'
|
|
11
|
-
s.files = `git ls-files`.split("
|
|
12
|
-
")
|
|
13
|
+
s.files = `git ls-files`.split("\n")
|
|
13
14
|
s.require_paths << 'lib'
|
|
14
|
-
s.extra_rdoc_files = ['README.rdoc','hook.rdoc']
|
|
15
|
+
s.extra_rdoc_files = ['README.rdoc', 'hook.rdoc']
|
|
15
16
|
s.rdoc_options << '--title' << 'hook' << '--main' << 'README.rdoc' << '-ri'
|
|
16
17
|
s.bindir = 'bin'
|
|
17
18
|
s.executables << 'hook'
|
|
18
|
-
s.add_development_dependency('
|
|
19
|
-
s.add_development_dependency('
|
|
20
|
-
s.add_development_dependency('
|
|
21
|
-
s.add_runtime_dependency('gli','2.19.0')
|
|
19
|
+
s.add_development_dependency('aruba', '~> 0.14.14')
|
|
20
|
+
s.add_development_dependency('rake', '~> 13.0.1')
|
|
21
|
+
s.add_development_dependency('rdoc', '~> 6.3.2')
|
|
22
|
+
s.add_runtime_dependency('gli', '2.19.0')
|
|
22
23
|
end
|
data/html/App.html
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>class App - hookapp</title>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "./";
|
|
11
|
+
var index_rel_prefix = "./";
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script src="./js/navigation.js" defer></script>
|
|
15
|
+
<script src="./js/search.js" defer></script>
|
|
16
|
+
<script src="./js/search_index.js" defer></script>
|
|
17
|
+
<script src="./js/searcher.js" defer></script>
|
|
18
|
+
<script src="./js/darkfish.js" defer></script>
|
|
19
|
+
|
|
20
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
|
21
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<body id="top" role="document" class="class">
|
|
25
|
+
<nav role="navigation">
|
|
26
|
+
<div id="project-navigation">
|
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
28
|
+
<h2>
|
|
29
|
+
<a href="./index.html" rel="home">Home</a>
|
|
30
|
+
</h2>
|
|
31
|
+
|
|
32
|
+
<div id="table-of-contents-navigation">
|
|
33
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
|
34
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
|
35
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
41
|
+
<div id="search-field-wrapper">
|
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
|
49
|
+
aria-busy="false" aria-expanded="false"
|
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
51
|
+
</form>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
<div id="class-metadata">
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
|
62
|
+
<h3>Parent</h3>
|
|
63
|
+
|
|
64
|
+
<p class="link">Object
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
<div id="extends-section" class="nav-section">
|
|
70
|
+
<h3>Extended With Modules</h3>
|
|
71
|
+
|
|
72
|
+
<ul class="link-list">
|
|
73
|
+
<li><span class="extend">GLI::App</span>
|
|
74
|
+
</ul>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
</div>
|
|
79
|
+
</nav>
|
|
80
|
+
|
|
81
|
+
<main role="main" aria-labelledby="class-App">
|
|
82
|
+
<h1 id="class-App" class="class">
|
|
83
|
+
class App
|
|
84
|
+
</h1>
|
|
85
|
+
|
|
86
|
+
<section class="description">
|
|
87
|
+
|
|
88
|
+
<p>Main class for <a href="GLI.html"><code>GLI</code></a> app</p>
|
|
89
|
+
|
|
90
|
+
</section>
|
|
91
|
+
|
|
92
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
</section>
|
|
99
|
+
</main>
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
<footer id="validator-badges" role="contentinfo">
|
|
103
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
|
104
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.2.
|
|
105
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
106
|
+
</footer>
|
|
107
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>module GLI::Commands::Doc - hookapp</title>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "../../";
|
|
11
|
+
var index_rel_prefix = "../../";
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script src="../../js/navigation.js" defer></script>
|
|
15
|
+
<script src="../../js/search.js" defer></script>
|
|
16
|
+
<script src="../../js/search_index.js" defer></script>
|
|
17
|
+
<script src="../../js/searcher.js" defer></script>
|
|
18
|
+
<script src="../../js/darkfish.js" defer></script>
|
|
19
|
+
|
|
20
|
+
<link href="../../css/fonts.css" rel="stylesheet">
|
|
21
|
+
<link href="../../css/rdoc.css" rel="stylesheet">
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<body id="top" role="document" class="module">
|
|
25
|
+
<nav role="navigation">
|
|
26
|
+
<div id="project-navigation">
|
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
28
|
+
<h2>
|
|
29
|
+
<a href="../../index.html" rel="home">Home</a>
|
|
30
|
+
</h2>
|
|
31
|
+
|
|
32
|
+
<div id="table-of-contents-navigation">
|
|
33
|
+
<a href="../../table_of_contents.html#pages">Pages</a>
|
|
34
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
|
35
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
41
|
+
<div id="search-field-wrapper">
|
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
|
49
|
+
aria-busy="false" aria-expanded="false"
|
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
51
|
+
</form>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
<div id="class-metadata">
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
</div>
|
|
65
|
+
</nav>
|
|
66
|
+
|
|
67
|
+
<main role="main" aria-labelledby="module-GLI::Commands::Doc">
|
|
68
|
+
<h1 id="module-GLI::Commands::Doc" class="module">
|
|
69
|
+
module GLI::Commands::Doc
|
|
70
|
+
</h1>
|
|
71
|
+
|
|
72
|
+
<section class="description">
|
|
73
|
+
|
|
74
|
+
</section>
|
|
75
|
+
|
|
76
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
</section>
|
|
83
|
+
</main>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
<footer id="validator-badges" role="contentinfo">
|
|
87
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
|
88
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.2.
|
|
89
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
90
|
+
</footer>
|
|
91
|
+
|