Skip to content

Instantly share code, notes, and snippets.

@nuke99
Created May 9, 2012 05:42
Show Gist options
  • Save nuke99/2642193 to your computer and use it in GitHub Desktop.
Save nuke99/2642193 to your computer and use it in GitHub Desktop.
#!/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 print_name(name)
puts "My Name is #{name}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment