dict 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/translate +13 -6
- metadata +1 -1
data/bin/translate
CHANGED
@@ -10,17 +10,24 @@ opts = Slop.parse do
|
|
10
10
|
banner "Usage: $translate -w word [Options]"
|
11
11
|
on '-w', :word=, 'after this option is a word to translate'
|
12
12
|
on '-h', :help=, 'help', :argument => :optional
|
13
|
-
on '-
|
14
|
-
on '-
|
15
|
-
on '-
|
13
|
+
on '-s', :services=, 'available services', :argument => :optional
|
14
|
+
#on '-t', :time=, 'time in seconds, default: 300 seconds', :as => :int
|
15
|
+
on '-d', :dict=, 'dictionaries: wiktionary, dictpl; default is all dictionaries'
|
16
16
|
end
|
17
17
|
|
18
18
|
# translation
|
19
|
-
|
19
|
+
if opts.word?
|
20
|
+
if opts.dict?
|
21
|
+
puts Dict.get_single_dictionary_translations(opts[:word],opts[:dict])
|
22
|
+
else
|
23
|
+
puts Dict.get_all_dictionaries_translations(opts[:word])
|
24
|
+
end
|
25
|
+
end
|
20
26
|
|
21
27
|
# help
|
22
28
|
puts opts if opts.help?
|
23
29
|
|
24
|
-
#
|
25
|
-
puts Dict
|
30
|
+
# services
|
31
|
+
puts Dict.available_services if opts.services?
|
32
|
+
|
26
33
|
|