Sha256: 267fa4e8de45d826656ba38508f79050066a2a1399756f0f056843b841f707db
Contents?: true
Size: 801 Bytes
Versions: 8
Compression:
Stored size: 801 Bytes
Contents
require 'optparse' module Vedeu class Configuration def self.configure(args = []) new(args).configure end def initialize(args = []) @args = args @options = {} end def configure parser = OptionParser.new do |opts| opts.banner = "Usage: #{$PROGRAM_NAME} [options]" opts.on('-1', '--run-once', 'Run application once.') do @options[:interactive] = false end opts.on('-c', '--cooked', 'Run application in cooked mode.') do @options[:mode] = :cooked end opts.on('-r', '--raw', 'Run application in raw mode (default).') do @options[:mode] = :raw end end parser.parse!(args) options end private attr_accessor :args, :options end end
Version data entries
8 entries across 8 versions & 1 rubygems