babelyoda 1.6.0 → 2.0.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.
@@ -1,42 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'optparse'
4
- require 'ostruct'
5
-
6
- module BabelYoda
7
- class Options
8
-
9
- #
10
- # Return a structure describing the options.
11
- #
12
- def self.parse
13
- # The options specified on the command line will be collected in *options*.
14
- # We set default values here.
15
- options = { 'rules' => 'rules.babelyoda' }
16
-
17
- optparser = OptionParser.new do |opts|
18
- opts.banner = "Usage: babelyoda [options]"
19
-
20
- opts.separator ""
21
- opts.separator "Common options:"
22
-
23
- # Optional argument; multi-line description.
24
- opts.on("-r", "--rules <RULES-FILE>",
25
- "Use the specified rules file.",
26
- "Default is 'babelyoda.rules'.") do |rules|
27
- options['rules'] = rules
28
- end
29
-
30
- # No argument, shows at tail. This will print an options summary.
31
- opts.on_tail("-h", "--help", "Show this message") do
32
- puts opts
33
- exit
34
- end
35
- end
36
-
37
- optparser.parse!
38
- options
39
- end
40
-
41
- end
42
- end