Class: Pitcher::PitcherOpts
- Inherits:
-
Object
- Object
- Pitcher::PitcherOpts
- Defined in:
- lib/pitcher/options.rb
Instance Method Summary collapse
Instance Method Details
#parse(args) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/pitcher/options.rb', line 7 def parse(args) = OpenStruct.new OptionParser.new do |opts| opts. = 'Usage: pitcher -csv /path/to/csv.file' opts.on("-csv", "--csv", 'Path to CSV file') do |csv| .csv = csv end opts.on("-settings", "--settings", "Path to the settings file") do |settings| .settings = settings end opts.on("-h", "--help", "Pitcher Help") do puts opts exit end end.parse! end |