Created
May 9, 2012 04:56
-
-
Save nuke99/2641917 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 | |
loka = opts[:name] | |
def namef(loka) | |
puts "My Name is #{loka}" | |
end | |
def agef(opts[:age]) | |
puts "and my age is #{opts[:age]}" | |
end | |
def testf(opts[:test]) | |
puts "and this could be something else as #{opts[:test]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment