Class: Mysqlknife::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/mysqlknife/cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ CLI

Returns a new instance of CLI.



7
8
9
10
11
# File 'lib/mysqlknife/cli.rb', line 7

def initialize(*args)
  super

  $DEBUG = options[:debug]
end

Instance Method Details

#command(conn = nil, host = nil, cmd = nil) ⇒ Object



49
50
51
52
53
54
55
56
57
58
# File 'lib/mysqlknife/cli.rb', line 49

def command(conn = nil, host = nil, cmd = nil)
  command = Parameter::Command.new
  command.connection = conn
  command.host       = host
  command.cmd        = cmd
  command.connections
  command.hosts
  command.commands
  command.connect
end

#config(conn = nil) ⇒ Object



14
15
16
17
18
19
# File 'lib/mysqlknife/cli.rb', line 14

def config(conn = nil)
  config = Parameter::Config.new
  config.connection = conn
  config.connections
  config.show
end

#console(conn = nil, host = nil) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/mysqlknife/cli.rb', line 26

def console(conn = nil, host = nil)
  console = Parameter::Console.new
  console.connection = conn
  console.host       = host
  console.execute    = options[:execute]
  console.connections
  console.hosts
  console.connect
end

#describe(conn = nil, host = nil, database = nil, table = nil) ⇒ Object



37
38
39
40
41
42
43
44
45
46
# File 'lib/mysqlknife/cli.rb', line 37

def describe(conn = nil, host = nil, database = nil, table = nil)
  describe = Parameter::Describe.new
  describe.connection = conn
  describe.host       = host
  describe.database   = database
  describe.table      = table
  describe.connections
  describe.hosts
  describe.connect
end

#versionObject



61
62
63
# File 'lib/mysqlknife/cli.rb', line 61

def version
  puts Mysqlknife::VERSION
end