Skip to content

Instantly share code, notes, and snippets.

@nuke99
Created May 1, 2012 18:41
Show Gist options
  • Save nuke99/2570365 to your computer and use it in GitHub Desktop.
Save nuke99/2570365 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'readline'
require './lib/trollop'
class Commands
def banner
puts 'This is a banner.'
end
def name
puts opt[:name]
end
end
class Front < Commands
def initialize
opts = Trollop::options do
#version conf::params['core']['version']
opt :name, 'Name', :short => 'n', :type => String, :required => true
opt :age, 'Age', :short => 'a', :type => Integer, :required => false
end
while cmd = Readline.readline("> ", true)
method, command = cmd.split
if self.respond_to?(method)
puts "#{method} is vaild"
self.send(method)
else
puts "[*] Unknown Mehotd"
end
end
end
end
font = Front.new()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment