#!/usr/bin/env ruby require 'optparse' $:.unshift File.expand_path("#{File.dirname(__FILE__)}/../lib") require 'git_meta' options = {:command => ARGV.shift || "get", :sha => ARGV.shift, :key => nil} optparser = OptionParser.new do |parser| parser.banner = "Usage: git-meta get [ sha | ref ] [ --get KEY ]" parser.on('-g', '--get KEY', "Retrives a certain KEY from the git commit object") do |key| options[:key] = key end parser.on('-h', '--help', "Returns Usage Notes") do puts parser exit end end if !options[:sha] puts optparser exit end optparser.parse(ARGV) @getter = GitMeta::Get.new(options[:sha], options[:key]) puts @getter