require "wpb/clamp/command" class Bash < Clamp::Command option ["-v", "--version"], :flag, "print version" def execute if version? require "wpb/version" print "WordPress Bash #{WPB::VERSION} (c) James Birtles" else irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb' libs = " -r irb/completion" libs << " -r #{File.expand_path('../../wpb.rb', __FILE__)}" puts "Connecting to database..." exec "#{irb} #{libs}" end end end