Class: Pbx::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


44
# File 'lib/pbx/cli.rb', line 44

def self.exit_on_failure? = true

Instance Method Details

#monitorObject



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/pbx/cli.rb', line 26

def monitor
  cli_opts = options.to_h.transform_keys(&:to_sym)
  debug = cli_opts.delete(:debug) { false }
  cfg = Config.load(cli: cli_opts)
  bridge = AmiBridge.new(cfg, debug: debug)
  Bubbletea.run(App.new(bridge: bridge, config: cfg), alt_screen: true)
rescue Config::Error => e
  warn "Error: #{e.message}"
  exit 1
ensure
  bridge&.shutdown
end

#versionObject



40
41
42
# File 'lib/pbx/cli.rb', line 40

def version
  puts "pbx #{Pbx::VERSION}"
end