class Mysqlknife::Parameter::Command

Attributes

cmd[W]

Public Instance Methods

commands() click to toggle source
# File lib/mysqlknife/parameter/command.rb, line 8
def commands
  if @connection.nil? == false &&
     @host.nil?       == false &&
     @cmd.nil?
    puts "Commands:"
    if @config.commands.nil? == false &&
       @config.commands.count > 0 &&
       @config.commands.is_a?(Array)
      @config.commands.each do |command|
        puts " - #{command}"
      end
    end
  end
end
connect() click to toggle source
# File lib/mysqlknife/parameter/command.rb, line 23
def connect
  if @connection.nil? == false &&
     @host.nil?       == false &&
     @cmd.nil?        == false
    @config.connection(@connection)
    puts "Connecting to: #{@config.select(@host)}"
    @command.execute(@mysql.parse(@config.command(@cmd)))
  end
end