Class: PolySSH::Cli

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCli

Returns a new instance of Cli.



20
21
22
23
# File 'lib/polyssh/cli.rb', line 20

def initialize
  @chain = NodeList.new
  @options = {}
end

Instance Attribute Details

#chainObject (readonly)

Returns the value of attribute chain.



8
9
10
# File 'lib/polyssh/cli.rb', line 8

def chain
  @chain
end

Class Method Details

.start(args) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/polyssh/cli.rb', line 10

def self.start args
  app = self.new
  app.parse_cmdline args

  app.build_commands app.chain

  #app.run commands

end

Instance Method Details

#build_commands(chain) ⇒ Object



32
33
34
35
# File 'lib/polyssh/cli.rb', line 32

def build_commands chain
  commands = chain.accept(CommandBuilder.new)
  return commands
end

#parse_cmdline(args) ⇒ Object



25
26
27
28
29
# File 'lib/polyssh/cli.rb', line 25

def parse_cmdline args
  _parse_cmdline_options args
  _parse_cmdline_hops args

end