16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/yaml_translate.rb', line 16
def parse! arguments=ARGV, defaults=@@defaults
@@defaults.dup.tap do |options|
OptionParser.new do |parser|
parser.banner = 'Usage: yaml_translate [options]'
parser.version = YamlTranslate::VERSION
parser.on('-lf', '--from LANG', 'Set the language to translate from') do |from|
options[:from] = from
end
parser.on('-lt', '--to LANG1,LANG2,...', Array, 'Set the language(s) to translate to') do |to|
options[:to] = to
end
parser.on('-f', '--file FILE', 'Specify the yaml-file to translate') do |file|
options[:file] = file
end
parser.on_tail('-h', '--help', 'Display this help information') do
puts parser
exit!
end
end.parse!
end
end
|