Class: Mysqlknife::CLI
- Inherits:
-
Thor
- Object
- Thor
- Mysqlknife::CLI
- Defined in:
- lib/mysqlknife/cli.rb
Instance Method Summary collapse
- #command(conn = nil, host = nil, cmd = nil) ⇒ Object
- #config(conn = nil) ⇒ Object
- #console(conn = nil, host = nil) ⇒ Object
- #describe(conn = nil, host = nil, database = nil, table = nil) ⇒ Object
-
#initialize(*args) ⇒ CLI
constructor
A new instance of CLI.
- #version ⇒ Object
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 = [: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 = [: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 |
#version ⇒ Object
61 62 63 |
# File 'lib/mysqlknife/cli.rb', line 61 def version puts Mysqlknife::VERSION end |