geturl 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/geturl +9 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d9ec99a5f37c46ebbbf76d465debe1abc47d11ee6875141fb4bd503a81ff983
4
- data.tar.gz: a267f7a3b1f5ec2cabf17644c7bf6d677f9b88051435c4fe39b625faaabd1741
3
+ metadata.gz: 5923ac3f2d759ce88b144f13615bee62d7deb992e6b5869f0a28ec182595080c
4
+ data.tar.gz: ae43f0db4b4788fec7d5defe8ffb3a6d48c4155c5b3229f33d9e030654da9038
5
5
  SHA512:
6
- metadata.gz: 8568cd64eb2f3441d7b8c725d0d1245f28c0656302ecb4e680d792a2a60019678c4c49208df1c5a5428c516fac0bc8f8f35f4cd68873bb7aa491a9cec3a2c76a
7
- data.tar.gz: 81a8416623afbc57f2046105bb3f6abd7f9727479cd6d9865476f5f516b7d8a9d577febe9c083a0a7ab9f527ebbfeca76d70d4c51b2e3aa5e4d0055ec93021a3
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geturl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taco Jan Osinga