Created
May 8, 2012 21:07
-
-
Save nuke99/2639283 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rubygems' | |
require './lib/trollop' | |
opts = Trollop::options do | |
version "test 1.1 " | |
banner <<-EOS | |
This is a sample banner for my test script | |
EOS | |
opt :name, "This is the name" , :short => 'n', :type=>String, :required => true | |
opt :age, "This is the value of age", :short => 'a' , :type=>Integer | |
opt :test, "this is a test command", :short => 't', :type=>String | |
end | |
def name(opts[:name]) | |
puts "My Name is #{opts[:name]}" | |
end | |
def age(opts[:age]) | |
puts "and my age is #{opts[:age]}" | |
end | |
def test(opts[:test]) | |
puts "and this could be something else as #{opts[:test]}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment