geturl 0.2.0 → 0.3.0
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/bin/geturl +9 -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: 5923ac3f2d759ce88b144f13615bee62d7deb992e6b5869f0a28ec182595080c
|
4
|
+
data.tar.gz: ae43f0db4b4788fec7d5defe8ffb3a6d48c4155c5b3229f33d9e030654da9038
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad48dc1848c152fec27faafebdf3c80a19363a8bd8b5de92341cb5b2e0abfdf2bc54ea2fddb5c72ee7c7959af9e1e30f695a91dc56ee4aa07cda9c0257b044f5
|
7
|
+
data.tar.gz: 6dcd57c7636541c87c7bcac2d61fefbc0bc733b261e0db88c5f1f5a00a2bf61aaef51f37c787c60e9baa74a392cc9fa879392984b7b6beb274a102acdfc32985
|
data/bin/geturl
CHANGED
@@ -10,10 +10,13 @@ module GetUrlCli
|
|
10
10
|
# Reads the command line and runs the selected action.
|
11
11
|
def run
|
12
12
|
flags = %w(--save --delete --reload --sources --register --unregister
|
13
|
-
--reload -v --show-all --match-all --color --show-score)
|
13
|
+
--reload -v --show-all --match-all -a --only-urls -u --color --show-score)
|
14
14
|
parameters = %w(--format --sources --tags --description --template -n)
|
15
15
|
@arguments, @options = CliParser.parse(flags, parameters)
|
16
16
|
|
17
|
+
@options['--match-all'] = @options['-a']
|
18
|
+
@options['--only-urls'] = @options['-u']
|
19
|
+
|
17
20
|
if @options.include?('--save')
|
18
21
|
save
|
19
22
|
elsif @options.include?('--delete')
|
@@ -153,6 +156,11 @@ module GetUrlCli
|
|
153
156
|
|
154
157
|
# Outputs the given data object in the selected format.
|
155
158
|
def output_data(data)
|
159
|
+
if @options['--only-urls']
|
160
|
+
@options['--format'] = 'mustache'
|
161
|
+
@options['--template'] = "{{#items}}{{url}}\n{{/items}}"
|
162
|
+
end
|
163
|
+
|
156
164
|
format = @options['--format'].to_s.downcase
|
157
165
|
if format == 'json'
|
158
166
|
puts JSON.pretty_generate(data)
|