Class: Pbx::CLI
- Inherits:
-
Thor
- Object
- Thor
- Pbx::CLI
- Defined in:
- lib/pbx/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
44 |
# File 'lib/pbx/cli.rb', line 44 def self.exit_on_failure? = true |
Instance Method Details
#monitor ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/pbx/cli.rb', line 26 def monitor cli_opts = .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.}" exit 1 ensure bridge&.shutdown end |