dictuby 0.0.3 → 0.0.4

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/lib/dictuby/args_parser.rb +34 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f781c7716139aeec617f877c4ff93ced7f133325
4
- data.tar.gz: b74509bb17a8e517958f36d8ec0c3f8fe792cc28
3
+ metadata.gz: fd1cce07d7fb71af851b8cf4d063dd214d968e1c
4
+ data.tar.gz: 8355d4cc06e64a257b43930050d43c031202cbaa
5
5
  SHA512:
6
- metadata.gz: b0fc2b5d8046e762d9c9ebc2af58ce0f1f5fac924f5dffd84e7baaf162896ab4e6c179dcfaf22c82b4d6496e7dad6c1572ed2c94d67995b2b2dc637384176c8d
7
- data.tar.gz: 5dd23373c8aed7f632775cd2c7c7999254ffe3c84c8a4ea0072ec538c1489d017808d247fc021e079a59f5f93a1c4df42799915f3335ff3b53da298597100ab0
6
+ metadata.gz: 108ab70f1ea2b4f0795429e66d00adb9857357fd20c4a3b4264313ce85bce47692d3b50146932f787edf276b222ecee1432bc6b6032c6efe7c555f2608993dcc
7
+ data.tar.gz: 6900dc9ed4ca10d4e1dece4ffbd6832c3e06beb539b621bb9eecffe1203e95b57a4f940a7a2eb8f4771d14bdb1c65e7ba6676a2353cead5d9def4a71e2825d0f
@@ -4,12 +4,41 @@ module Dictuby
4
4
  def self.parse(args)
5
5
  options = {}
6
6
 
7
+ args << '--help' if args.empty?
8
+
7
9
  OptionParser.new do |o|
8
- o.on('-h') { puts o; exit }
9
- o.on('-l') { |b| options[:list] = b }
10
- o.on('-g') { |b| options[:get] = b }
11
- o.on('-s DICTIONARY') { |d| options[:set] = d }
12
- o.on('QUERY') { }
10
+ o.on(
11
+ '-h',
12
+ '--help',
13
+ 'Display this message'
14
+ ) do
15
+ puts o; exit
16
+ end
17
+
18
+ o.on(
19
+ '-l',
20
+ '--list-dicts',
21
+ 'List available dictionaries'
22
+ ) do |b|
23
+ options[:list] = b
24
+ end
25
+
26
+ o.on(
27
+ '-g',
28
+ '--get-dict',
29
+ 'Display current active dictionary'
30
+ ) do |b|
31
+ options[:get] = b
32
+ end
33
+
34
+ o.on(
35
+ '-s DICTIONARY',
36
+ '--set-dict DICTIONARY',
37
+ 'Set active dictionary'
38
+ ) do |d|
39
+ options[:set] = d
40
+ end
41
+ o.on('QUERY') {}
13
42
  o.parse!
14
43
  end
15
44
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dictuby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rene Klacan