lyracyst 0.0.9 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb07368fe2368b27ee37ec8f70d7f2d2a148db91
4
- data.tar.gz: 22429d86922fcb5e73fe5a98981923da40e8d46b
3
+ metadata.gz: 7751d12d85b26befa84563c35152c9275f2603e3
4
+ data.tar.gz: 719eead3fb8cf83e71643931abf11155ab8d657b
5
5
  SHA512:
6
- metadata.gz: 500198b5c4ee3a14352f07b62f0efd98f01dc62506fc2e93d9e851278537824a3b16c389afbe3e94d4b3f0999c399615255753755c541d25ff424d6d57ea10ec
7
- data.tar.gz: 00aa7522afc18725af26ae6076fe31d4376bb18877e07db6baccaac69e2adced4757103dc675923688b10b11998a6ddc6745c27bb2f68967969380ed5f15a750
6
+ metadata.gz: 27d43324ff46751095c76d121dfd47956659826c03bae613df1692cd5db92dd5f74a7a3efab892ffba905843999821b8e0f867f7d7a215fc92deaf7e32441e48
7
+ data.tar.gz: 4113d612eb6cb24ba000e0e23023b15956c46cfc2f059c7a0fa5ea2233e17c4ff27324f44395ab851159bf87d9e744e2f1d9d856aa1eba99fb7c0d99f7a2dd91
@@ -1,6 +1,16 @@
1
1
  Changelog
2
2
  ===
3
3
 
4
+ Version **1.0.0** - Subcommands, More options, Onelook
5
+ - Added word info from [Onelook.com](http://www.onelook.com/?c=faq)
6
+ - Added more CLI options
7
+ - Shortened command names and added subcommands
8
+
9
+ Version 0.0.9 - File export, Urban Dictionary, Code Climate
10
+ - Added definitions from Urban Dictionary
11
+ - Added JSON & XML export
12
+ - Restructured code to improve climate
13
+
4
14
  Version 0.0.8 - Major Improvements
5
15
  - The biggest milestone yet!
6
16
  - Most Wordnik search functions now work
@@ -1,23 +1,25 @@
1
1
  #!/usr/bin/env ruby
2
2
  # coding: utf-8
3
- #%w(curb em-synchrony em-http eventmachine excon httpclient httpi net/http/persistent rainbow).map {|lib| require lib}
4
- #%w(json/ext json/pure multi_json oj yajl).map {|lib| require lib}
5
- #%w(libxml multi_xml ox rexml/document).map {|lib| require lib}
3
+ # %w(curb em-synchrony em-http eventmachine excon httpclient httpi net/http/persistent rainbow).map { |lib| require lib }
4
+ # %w(json/ext json/pure multi_json oj yajl).map { |lib| require lib }
5
+ # %w(libxml multi_xml ox rexml/document).map { |lib| require lib }
6
6
  require 'gli'
7
+ require 'lyracyst/onelook'
7
8
  require 'lyracyst/rhymebrain'
8
9
  require 'lyracyst/urban'
9
10
  require 'lyracyst/version'
10
11
  require 'lyracyst/wordnik'
11
12
  require 'xml-fu'
12
- module Lyracyst
13
13
 
14
+ # The Lyracyst module handles base functionality.
15
+ module Lyracyst
14
16
  HTTPI.log = false
15
17
 
16
18
  # Optionally sets HTTP adapter with httpi. Supports [:httpclient,
17
19
  # :curb, :em_http, :net_http_persistent, :excon, :rack]
18
20
  #
19
21
  # @param http [Symbol] The http adapter to use. Smart defaults.
20
- def self.set_http(http)
22
+ def self.http(http)
21
23
  HTTPI.adapter = http
22
24
  end
23
25
 
@@ -25,7 +27,7 @@ module Lyracyst
25
27
  # :yajl, :json_gem, :json_pure]
26
28
  #
27
29
  # @param mj [Symbol] The JSON adapter to use. Smart defaults.
28
- def self.set_json(mj)
30
+ def self.json(mj)
29
31
  MultiJson.use(mj)
30
32
  end
31
33
 
@@ -33,7 +35,7 @@ module Lyracyst
33
35
  # :libxml, :nokogiri, :rexml]
34
36
  #
35
37
  # @param mx [Symbol] The XML adapter to use. Smart defaults.
36
- def self.set_xml(mx)
38
+ def self.xml(mx)
37
39
  MultiXml.parser = mx
38
40
  end
39
41
 
@@ -46,6 +48,15 @@ module Lyracyst
46
48
  print Rainbow(']').blue.bright
47
49
  print Rainbow('|').bright
48
50
  end
51
+
52
+ # Adds an object to the outfile array.
53
+ #
54
+ # @param obj [String] The item to add
55
+ def self.tofile(obj)
56
+ if $fmt != nil
57
+ $tofile.push obj
58
+ end
59
+ end
49
60
  end
50
61
 
51
62
  include GLI::App
@@ -53,268 +64,162 @@ program_desc 'A powerful word search tool that fetches definitions, related word
53
64
  config_file '.lyracyst.yml'
54
65
  version Lyracyst::VERSION
55
66
 
56
- desc 'Force overwrite'
57
- long_desc 'Overwrites existing JSON & XML files'
58
- switch [:f,:force]
59
-
60
- desc 'HTTP adapter'
61
- long_desc 'httpclient, curb, em_http, net_http_persistent, excon, rack'
62
- default_value :net_http_persistent
63
- arg_name 'http'
64
- flag [:h,:http]
65
-
66
- desc 'JSON adapter'
67
- long_desc 'oj, yajl, json_gem, json_pure'
68
- default_value :oj
69
- arg_name 'json'
70
- flag [:j,:json]
67
+ flag [:f, :format], :default_value => nil, :arg_name => 'fmt', :desc => 'File format', :long_desc => 'json or xml'
68
+ flag [:h, :http], :default_value => :net_http_persistent, :arg_name => 'http', :desc => 'HTTP adapter', :long_desc => 'httpclient, curb, em_http, net_http_persistent, excon, rack'
69
+ flag [:j, :json], :default_value => :oj, :arg_name => 'json', :desc => 'JSON adapter', :long_desc => 'oj, yajl, json_gem, json_pure'
70
+ flag [:o, :out], :default_value => nil, :arg_name => 'outfile', :desc => 'Output file', :long_desc => 'filename.json or filename.xml'
71
+ flag [:x, :xml], :default_value => :rexml, :arg_name => 'xml', :desc => 'XML adapter', :long_desc => 'ox, libxml, nokogiri, rexml'
72
+ switch [:fo, :force], :default_value => false, :desc => 'Force overwrite', :long_desc => 'Overwrites existing JSON & XML files'
73
+ switch [:v, :verbose], :default_value => false, :desc => 'Prints parameters and options'
71
74
 
72
- desc 'Output file'
73
- long_desc 'filename.json or filename.xml'
74
- default_value nil
75
- arg_name 'outfile'
76
- flag [:o,:out]
77
-
78
- desc 'XML adapter'
79
- long_desc 'ox, libxml, nokogiri, rexml'
80
- default_value :rexml
81
- arg_name 'xml'
82
- flag [:x,:xml]
83
-
84
- desc 'Fetches definitions from Wordnik'
85
- arg_name 'word'
86
- command :define do |c|
87
- c.desc 'Comma-separated list of parts of speech. See http://developer.wordnik.com/docs.html#!/word/getDefinitions_get_2 for list of parts.'
88
- c.default_value nil
89
- c.arg_name 'part'
90
- c.flag [:p,:part]
91
- c.desc "Source dictionary to return definitions from. If 'all' is received, results are returned from all sources. If multiple values are received (e.g. 'century,wiktionary'), results are returned from the first specified dictionary that has definitions. If left blank, results are returned from the first dictionary that has definitions. By default, dictionaries are searched in this order: ahd, wiktionary, webster, century, wordnet"
92
- c.default_value 'all'
93
- c.arg_name 'defdict'
94
- c.flag [:defdict]
95
- c.action do |global_options,options,args|
96
- # If you have any errors, just raise them
97
- # raise "that command made no sense"
98
- search = args[0]
99
- part = options[:p]
100
- params = {limit: 10, increl: false, canon: false, inctags: false}
101
- params[:defdict] = options[:defdict]
102
- df = Lyracyst::Wordnik::Define.new
103
- df.get_def(search, part, params)
75
+ desc 'Wordnik operations'
76
+ arg_name 'wordnik'
77
+ command :wn do |nik|
78
+ nik.switch :canon, :default_value => false, :desc => 'Use canonical', :long_desc => "If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested."
79
+ nik.flag :limit, :default_value => 5, :arg_name => 'limit', :desc => 'Maximum number of results to return'
80
+ nik.desc 'Fetch definitions from Wordnik'
81
+ nik.arg_name 'define'
82
+ nik.command :def do |define|
83
+ define.flag :defdict, :default_value => 'all', :arg_name => 'defdict', :desc => "CSV list. Source dictionaries to return definitions from. If 'all' is received, results are returned from all sources. If multiple values are received (e.g. 'century,wiktionary'), results are returned from the first specified dictionary that has definitions. If left blank, results are returned from the first dictionary that has definitions. By default, dictionaries are searched in this order: ahd, wiktionary, webster, century, wordnet"
84
+ define.flag [:p, :part], :default_value => nil, :arg_name => 'part', :desc => 'Comma-separated list of parts of speech. See http://developer.wordnik.com/docs.html#!/word/getDefinitions_get_2 for list of parts.'
85
+ define.action do |global_options, options, args|
86
+ search = args[0]
87
+ params = { canon: options[:canon], defdict: options[:defdict], increl: false, inctags: false, limit: options[:limit] }
88
+ df = Lyracyst::Wordnik::Define.new
89
+ df.get_def(search, options[:p], params)
90
+ end
104
91
  end
105
- end
106
-
107
- desc 'Fetches examples from Wordnik'
108
- arg_name 'word'
109
- command :example do |c|
110
- c.desc 'Results to skip'
111
- c.default_value 0
112
- c.arg_name 'skip'
113
- c.flag [:s,:skip]
114
- c.desc 'Maximum number of results to return'
115
- c.default_value 5
116
- c.arg_name 'limit'
117
- c.flag [:limit]
118
- c.action do |global_options,options,args|
119
- search = args[0]
120
- skip = options[:s]
121
- limit = options[:limit]
122
- params = {incdups: false, canon: false}
123
- params[:skip] = skip
124
- params[:limit] = limit
125
- ex = Lyracyst::Wordnik::Example.new
126
- ex.get_ex(search, params)
92
+ nik.desc 'Fetch examples from Wordnik'
93
+ nik.arg_name 'example'
94
+ nik.command :ex do |example|
95
+ example.flag [:s, :skip], :default_value => 0, :arg_name => 'skip', :desc => 'Results to skip'
96
+ example.switch :incdups, :default_value => false, :desc => 'Show duplicate examples from different sources'
97
+ example.action do |global_options, options, args|
98
+ search = args[0]
99
+ params = { canon: options[:canon], incdups: options[:incdups], limit: options[:limit], skip: options[:s] }
100
+ ex = Lyracyst::Wordnik::Example.new
101
+ ex.get_ex(search, params)
102
+ end
127
103
  end
128
- end
129
-
130
- desc 'Fetches related words from Wordnik'
131
- arg_name 'word'
132
- command :relate do |c|
133
- c.desc 'Limits the total results per type of relationship type'
134
- c.default_value nil
135
- c.arg_name 'reltypes'
136
- c.flag [:relt]
137
- c.desc 'Restrict to the supplied relationship types'
138
- c.default_value 10
139
- c.arg_name 'rell'
140
- c.flag [:rell]
141
- c.action do |global_options,options,args|
142
- search = args[0]
143
- reltypes = options[:relt]
144
- rellimit = options[:rell]
145
- params = {canon: false}
146
- params[:rellimit] = rellimit
147
- ex = Lyracyst::Wordnik::Relate.new
148
- ex.get_rel(search, params, reltypes)
104
+ nik.desc 'Fetches related words from Wordnik'
105
+ nik.arg_name 'relate'
106
+ nik.command :rel do |relate|
107
+ relate.flag :relt, :default_value => nil, :arg_name => 'reltypes', :desc => 'Limits the total results per type of relationship type'
108
+ relate.flag :rell, :default_value => 10, :arg_name => 'rell', :desc => 'Restrict to the supplied relationship types'
109
+ relate.action do |global_options, options, args|
110
+ search = args[0]
111
+ params = { canon: options[:canon], rellimit: options[:rell] }
112
+ ex = Lyracyst::Wordnik::Relate.new
113
+ ex.get_rel(search, params, options[:relt])
114
+ end
149
115
  end
150
- end
151
-
152
- desc 'Fetches pronunciations from Wordnik'
153
- arg_name 'word'
154
- command :pronounce do |c|
155
- c.desc 'Get from a single dictionary. Valid options: ahd, century, cmu, macmillan, wiktionary, webster, or wordnet'
156
- c.default_value nil
157
- c.arg_name 'source'
158
- c.flag [:src]
159
- c.desc 'Text pronunciation type'
160
- c.long_desc 'ahd, arpabet, gcide-diacritical, IPA'
161
- c.default_value nil
162
- c.arg_name 'ptype'
163
- c.flag [:pt]
164
- c.desc 'Maximum number of results to return'
165
- c.default_value 5
166
- c.arg_name 'limit'
167
- c.flag [:limit]
168
- c.action do |global_options,options,args|
169
- search = args[0]
170
- source = options[:src]
171
- ptype = options[:pt]
172
- limit = options[:limit]
173
- params = {canon: false}
174
- params[:source] = source
175
- params[:limit] = limit
176
- pr = Lyracyst::Wordnik::Pronounce.new
177
- pr.get_pro(search, params, ptype)
116
+ nik.desc 'Fetches pronunciations from Wordnik'
117
+ nik.arg_name 'pronounce'
118
+ nik.command :pro do |pronounce|
119
+ pronounce.flag :src, :default_value => nil, :arg_name => 'source', :desc =>'Get from a single dictionary. Valid options: ahd, century, cmu, macmillan, wiktionary, webster, or wordnet'
120
+ pronounce.flag :pt, :default_value => nil, :arg_name => 'ptype', :desc => 'Text pronunciation type', :long_desc => 'ahd, arpabet, gcide-diacritical, IPA'
121
+ pronounce.action do |global_options, options, args|
122
+ search = args[0]
123
+ params = { canon: options[:canon], limit: options[:limit], source: options[:src] }
124
+ pr = Lyracyst::Wordnik::Pronounce.new
125
+ pr.get_pro(search, params, options[:pt])
126
+ end
178
127
  end
179
- end
180
-
181
- desc 'Fetches hyphenation and syllable stresses from Wordnik. Primary stress is red, secondary stress is bright white.'
182
- arg_name 'word'
183
- command :hyphen do |c|
184
- c.desc "Get from a single dictionary. Valid options: ahd, century, wiktionary, webster, and wordnet."
185
- c.default_value nil
186
- c.arg_name 'source'
187
- c.flag [:src]
188
- c.desc 'Maximum number of results to return'
189
- c.default_value 5
190
- c.arg_name 'limit'
191
- c.flag [:limit]
192
- c.action do |global_options,options,args|
193
- search = args[0]
194
- source = options[:src]
195
- limit = options[:limit]
196
- params = {canon: false}
197
- if source != nil then params[:source] = source; end
198
- params[:limit] = limit
199
- hyph = Lyracyst::Wordnik::Hyphen.new
200
- hyph.get_hyph(search, params)
128
+ nik.desc 'Fetches hyphenation and syllable stresses from Wordnik. Primary stress is red, secondary stress is bright white.'
129
+ nik.arg_name 'hyphen'
130
+ nik.command :hyph do |hyphen|
131
+ hyphen.flag :source, :default_value => nil, :arg_name => 'source', :desc => "Get from a single dictionary. Valid options: ahd, century, wiktionary, webster, and wordnet."
132
+ hyphen.action do |global_options, options, args|
133
+ search = args[0]
134
+ params = { canon: options[:canon], limit: options[:limit] }
135
+ if options[:source] != nil then params[:source] = options[:source]; end
136
+ hyph = Lyracyst::Wordnik::Hyphen.new
137
+ hyph.get_hyph(search, params)
138
+ end
201
139
  end
202
- end
203
-
204
- desc 'Fetches bi-gram phrases from Wordnik'
205
- arg_name 'word'
206
- command :phrase do |c|
207
- c.desc 'Maximum number of results to return'
208
- c.default_value 10
209
- c.arg_name 'limit'
210
- c.flag [:limit]
211
- c.desc 'Minimum WLMI(weighted mutual info) for the phrase.'
212
- c.default_value 13
213
- c.arg_name 'wlmi'
214
- c.flag [:wlmi]
215
- c.action do |global_options,options,args|
216
- search = args[0]
217
- limit = options[:limit]
218
- wlmi = options[:wlmi]
219
- params = {canon: false}
220
- params[:limit] = limit
221
- params[:wlmi] = wlmi
222
- phra = Lyracyst::Wordnik::Phrase.new
223
- phra.get_phr(search, params)
140
+ nik.desc 'Fetches bi-gram phrases from Wordnik'
141
+ nik.arg_name 'phrase'
142
+ nik.command :phr do |phrase|
143
+ phrase.flag :wlmi, :default_value => 13, :arg_name => 'wlmi', :desc => 'Minimum WLMI(weighted mutual info) for the phrase.'
144
+ phrase.action do |global_options, options, args|
145
+ search = args[0]
146
+ params = { canon: options[:canon], limit: options[:limit], wlmi: options[:wlmi] }
147
+ phra = Lyracyst::Wordnik::Phrase.new
148
+ phra.get_phr(search, params)
149
+ end
224
150
  end
225
- end
226
-
227
- desc 'Fetches etymologies from Wordnik'
228
- arg_name 'word'
229
- command :origin do |c|
230
- c.action do |global_options,options,args|
231
- search = args[0]
232
- params = {canon: false}
233
- orig = Lyracyst::Wordnik::Origin.new
234
- orig.get_et(search, params)
151
+ nik.desc 'Fetches etymologies from Wordnik'
152
+ nik.arg_name 'origin'
153
+ nik.command :ori do |origin|
154
+ origin.action do |global_options, options, args|
155
+ search = args[0]
156
+ params = { canon: options[:canon] }
157
+ orig = Lyracyst::Wordnik::Origin.new
158
+ orig.get_et(search, params)
159
+ end
235
160
  end
236
161
  end
237
162
 
238
- desc 'Fetches rhymes from Rhymebrain.com'
239
- arg_name 'word'
240
- command :rhyme do |c|
241
- c.desc 'ISO639-1 language code (optional). Eg. en, de, es, fr, ru'
242
- c.default_value 'en'
243
- c.arg_name 'lang'
244
- c.flag [:lang]
245
- c.desc '(optional) The number of results to return. If you do not include this parameter, RhymeBrain will choose how many words to show based on how many good sounding rhymes there are for the word.'
246
- c.default_value nil
247
- c.arg_name 'max'
248
- c.flag [:max]
249
- c.action do |global_options,options,args|
250
- search = args[0]
251
- lang = options[:lang]
252
- max = options[:max]
253
- params = {}
254
- params[:lang] = lang
255
- params[:max] = max
256
- rhym = Lyracyst::Rhymebrain::Rhyme.new
257
- rhym.get_rhyme(search, params)
163
+ desc 'Rhymebrain operations'
164
+ arg_name 'rhymebrain'
165
+ command :rb do |rb|
166
+ rb.flag :lang, :default_value => 'en', :arg_name => 'lang', :desc => 'ISO639-1 language code (optional). Eg. en, de, es, fr, ru'
167
+ rb.flag :max, :default_value => nil, :arg_name => 'max', :desc => '(optional) The number of results to return. If you do not include this parameter, RhymeBrain will choose how many words to show based on how many good sounding rhymes there are for the word.'
168
+ rb.desc 'Fetches rhymes from Rhymebrain.com'
169
+ rb.arg_name 'rhyme'
170
+ rb.command :rhy do |rhyme|
171
+ rhyme.action do |global_options, options, args|
172
+ search = args[0]
173
+ params = { lang: options[:lang], max: options[:max] }
174
+ rhym = Lyracyst::Rhymebrain::Rhyme.new
175
+ rhym.get_rhyme(search, params)
176
+ end
258
177
  end
259
- end
260
-
261
- desc 'Fetches word info from Rhymebrain.com'
262
- arg_name 'word'
263
- command :info do |c|
264
- c.desc 'ISO639-1 language code (optional). Eg. en, de, es, fr, ru'
265
- c.default_value 'en'
266
- c.arg_name 'lang'
267
- c.flag [:lang]
268
- c.desc '(optional) The number of results to return. If you do not include this parameter, RhymeBrain will choose how many words to show based on how many good sounding rhymes there are for the word.'
269
- c.default_value nil
270
- c.arg_name 'max'
271
- c.flag [:max]
272
- c.action do |global_options,options,args|
273
- search = args[0]
274
- lang = options[:lang]
275
- max = options[:max]
276
- params = {}
277
- params[:lang] = lang
278
- params[:max] = max
279
- info = Lyracyst::Rhymebrain::Info.new
280
- info.get_info(search, params)
178
+ rb.desc 'Fetches word info from Rhymebrain.com'
179
+ rb.arg_name 'info'
180
+ rb.command :inf do |info|
181
+ info.action do |global_options, options, args|
182
+ search = args[0]
183
+ params = { lang: options[:lang], max: options[:max] }
184
+ info = Lyracyst::Rhymebrain::Info.new
185
+ info.get_info(search, params)
186
+ end
187
+ end
188
+ rb.desc 'Fetches combined words (portmanteaus) from Rhymebrain.com'
189
+ rb.arg_name 'combine'
190
+ rb.command :comb do |combine|
191
+ combine.action do |global_options, options, args|
192
+ search = args[0]
193
+ params = { lang: options[:lang], max: options[:max] }
194
+ port = Lyracyst::Rhymebrain::Combine.new
195
+ port.get_port(search, params)
196
+ end
281
197
  end
282
198
  end
283
199
 
284
- desc 'Fetches combined words (portmanteaus) from Rhymebrain.com'
200
+ desc 'Fetches definitions from Urban Dictionary'
285
201
  arg_name 'word'
286
- command :combine do |c|
287
- c.desc 'ISO639-1 language code (optional). Eg. en, de, es, fr, ru'
288
- c.default_value 'en'
289
- c.arg_name 'lang'
290
- c.flag [:lang]
291
- c.desc '(optional) The number of results to return. If you do not include this parameter, RhymeBrain will choose how many words to show based on how many good sounding rhymes there are for the word.'
292
- c.default_value nil
293
- c.arg_name 'max'
294
- c.flag [:max]
295
- c.action do |global_options,options,args|
202
+ command :urb do |c|
203
+ c.action do |global_options, options, args|
296
204
  search = args[0]
297
- lang = options[:lang]
298
- max = options[:max]
299
- params = {}
300
- params[:lang] = lang
301
- params[:max] = max
302
- port = Lyracyst::Rhymebrain::Combine.new
303
- port.get_port(search, params)
205
+ ur = Lyracyst::Urban::Define.new
206
+ ur.get_def(search)
304
207
  end
305
208
  end
306
209
 
307
- desc 'Fetches definitions from Urban Dictionary'
210
+ desc 'Fetches word info from Onelook'
308
211
  arg_name 'word'
309
- command :urban do |c|
310
- c.action do |global_options,options,args|
212
+ command :look do |c|
213
+ c.switch :source, :default_value => false, :desc => 'Fetches resource links (verbose)'
214
+ c.action do |global_options, options, args|
311
215
  search = args[0]
312
- ur = Lyracyst::Urban::Define.new
313
- ur.get_def(search)
216
+ source = options[:source]
217
+ fe = Lyracyst::Onelook::Fetch.new
218
+ fe.fetch(search, source)
314
219
  end
315
220
  end
316
221
 
317
- pre do |global,command,options,args|
222
+ pre do |global, command, options, args|
318
223
  # Pre logic here
319
224
  # Return true to proceed; false to abort and not call the
320
225
  # chosen command
@@ -335,30 +240,27 @@ pre do |global,command,options,args|
335
240
  json = global[:j]
336
241
  xml = global[:x]
337
242
  if http.class != Symbol then http = http.to_sym; end
338
- Lyracyst.set_http(http)
243
+ Lyracyst.http(http)
339
244
  if json.class != Symbol then json = json.to_sym; end
340
- Lyracyst.set_json(json)
245
+ Lyracyst.json(json)
341
246
  if xml.class != Symbol then xml = xml.to_sym; end
342
- Lyracyst.set_xml(xml)
343
- label = 'Global options'
344
- Lyracyst.label(label)
345
- print "➜#{global}"
346
- label = 'Command'
347
- Lyracyst.label(label)
348
- print "➜#{command.name}➜"
349
- label = 'Command options'
350
- Lyracyst.label(label)
351
- print "➜#{options}"
352
- label = 'Args'
353
- Lyracyst.label(label)
354
- print "➜#{args}➜"
355
- label = 'Bootstrapped'
356
- Lyracyst.label(label)
357
- puts ''
247
+ Lyracyst.xml(xml)
248
+ if global[:v]
249
+ Lyracyst.label('Global options')
250
+ print "#{global}"
251
+ Lyracyst.label('Command')
252
+ print "#{command.name}"
253
+ Lyracyst.label('Command options')
254
+ print "#{options}"
255
+ Lyracyst.label('Args')
256
+ print "#{args}"
257
+ Lyracyst.label('Bootstrapped')
258
+ puts ''
259
+ end
358
260
  true
359
261
  end
360
262
 
361
- post do |global,command,options,args|
263
+ post do |global, command, options, args|
362
264
  # Post logic here
363
265
  # Use skips_post before a command to skip this
364
266
  # block on that command only
@@ -415,9 +317,10 @@ post do |global,command,options,args|
415
317
  puts Rainbow("Word search was written to #{outfile}.").bright
416
318
  end
417
319
  end
418
- label = 'Shutdown'
419
- Lyracyst.label(label)
420
- puts ''
320
+ if global[:v]
321
+ Lyracyst.label('Shutdown')
322
+ puts ''
323
+ end
421
324
  end
422
325
 
423
326
  on_error do |exception|