Sha256: 7a6dc537bef54619e57327370c8668332f308a9f80d423a926ea04ee4beff64d

Contents?: true

Size: 827 Bytes

Versions: 2

Compression:

Stored size: 827 Bytes

Contents

module Oci8Simple
  module Command
    def self.included(base)
      base.extend ClassMethods
    end
    
    module ClassMethods
      
      # Returns an OptionParser object. 
      def parse_options(banner)
        @options= {:environment => "development"}
        o = OptionParser.new do |opt|
          opt.banner = banner
          opt.on("-c", "--show_column_names", "Show column names for each result") do
            @options[:hash] = true
          end
          opt.on("-e", "--environment ENV", "Set environment. Defaults to development") do |e|
            @options[:environment] = e
          end
          opt.on("-v", "--version", "Show version") do
            puts "#{self.to_s} #{Oci8Simple::VERSION}"
            exit
          end
        end
        o.parse!
        o
      end
      
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
oci8_simple-1.0.1 lib/oci8_simple/command.rb
oci8_simple-1.0.0 lib/oci8_simple/command.rb