Class: Yalphabetize::OptionParser

Inherits:
Object
  • Object
show all
Defined in:
lib/yalphabetize/option_parser.rb

Constant Summary collapse

PARSER =
::OptionParser.new do |o|
  o.banner = 'Usage: yalphabetize [options] [file1, file2, ...]'

  o.on('-a', '--autocorrect', 'Automatically alphabetize inspected yaml files')
  o.on('-h', '--help', 'Prints this help') do
    puts o
    Kernel.exit
  end
end

Class Method Summary collapse

Class Method Details

.parse!(argv) ⇒ Object



17
18
19
# File 'lib/yalphabetize/option_parser.rb', line 17

def self.parse!(argv)
  {}.tap { |options| PARSER.parse!(argv, into: options) }
end