Class: Filecop::Options
- Inherits:
-
Object
- Object
- Filecop::Options
- Defined in:
- lib/filecop/options.rb
Class Method Summary collapse
Class Method Details
.parse!(args) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/filecop/options.rb', line 5 def self.parse!(args) # The options specified on the command line will be collected here = OpenStruct.new .json = false opt_parser = OptionParser.new do |opts| opts. = 'Usage: filecop [options] [file1, file2, ...]' opts.on("-j", "--json", "Output as JSON") do |v| .json = true end opts.on_tail('--version', 'Show version') do puts Filecop::VERSION exit end end opt_parser.parse!(args) [, args] end |