class SshMenu::SshMenu

Public Class Methods

run(args) click to toggle source
# File lib/sshmenu.rb, line 7
def self.run(args)
  options = Options.new(args).opts
  config = Config.new
  actions = Actions.new(config)

  selection = if options.empty?
    Selector.new(config.connections).select
  else
    options
  end

  actions.edit if selection[:action] == :edit
  actions.connect selection[:index] if selection[:index]

rescue ConfigException => e
  puts e.message
  Actions.ask_edit_with_default_editor
rescue => e
  puts(e.message) unless $DEBUG
end